Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 19-05-2006, 19:46   #1 (permalink)
KD*
derkzer
 
Registriert seit: Jan 2004
Beiträge: 30
MC attachen / vervielfältigen + lacoTween

Hallo Ihr,

hänge nach meinem kleinen random-problem (Random-Werte zuweisen | laco-tween) vom letzten Wochende an etwas neuem und komme einfach nicht auf eine Lösung.

Mein Problem
Ich attache via attachMovie aus der Bibliothek einen mc den ich dann vervielfältige und diese dann nach belieben tweene. Soweit alles ok! jedoch:
  • Bei diesem Tweening kommt es zu einer verschiebung auf der x-achse die nicht sein sollte...(?)
  • wie ändere ich die Tiefe so, dass andere mcs auf der Bühne über den attachten mcs liegen?

Hier der AS:

Code:
#include "lmc_tween.as"
/////////////////////////////////// BUTTON
button.onRelease = function() {
	beweg1();
};
/////////////////////////////////// CREATE MCs
function createmcs1() {
	var i:Number = 50;
	for (var x = 1; x<i; x++) {
		this.attachMovie("t_bg", "t_bg"+x, x, {_y:50});
	}
}
createmcs1();
/////////////////////////////////// TWEENs
var xKo = 40;
var yKo = 40;
var animationtype2 = 'easeOutSlap';
function firstmove() {
	t_bg1.tween('_y', yKo, 1, animationtype2, 2);
	t_bg1.tween('_x', xKo+250, 1, animationtype2, 2);
	t_bg1.tween('_width', 210, 0.5, animationtype2, 0);
	t_bg1.tween('_height', 25, 0, animationtype2, 2);
	t_bg2.tween('_y', yKo+25, 1, animationtype2, 2);
	t_bg2.tween('_x', xKo, 1, animationtype2, 2);
	t_bg2.tween('_width', 527, 0.5, animationtype2, 0);
	t_bg2.tween('_height', 25, 0, animationtype2, 2);
	t_bg3.tween('_y', yKo+50, 1, animationtype2, 2);
	t_bg3.tween('_x', xKo, 1, animationtype2, 2);
	t_bg3.tween('_width', 552, 0.5, animationtype2, 0);
	t_bg3.tween('_height', 25.25, 0, animationtype2, 2);
	t_bg4.tween('_y', yKo+75, 1, animationtype2, 2);
	t_bg4.tween('_x', xKo, 1, animationtype2, 2);
	t_bg4.tween('_width', 537, 0.5, animationtype2, 0);
	t_bg4.tween('_height', 25, 0, animationtype2, 2);
	t_bg5.tween('_y', yKo+100, 1, animationtype2, 2);
	t_bg5.tween('_x', xKo, 1, animationtype2, 2);
	t_bg5.tween('_width', 552, 0.5, animationtype2, 0);
	t_bg5.tween('_height', 25, 0, animationtype2, 2);
	t_bg6.tween('_y', yKo+125, 1, animationtype2, 2);
	t_bg6.tween('_x', xKo, 1, animationtype2, 2);
	t_bg6.tween('_width', 530, 0.5, animationtype2, 0);
	t_bg6.tween('_height', 25, 0, animationtype2, 2);
	t_bg7.tween('_y', yKo+150, 1, animationtype2, 2);
	t_bg7.tween('_x', xKo, 1, animationtype2, 2);
	t_bg7.tween('_width', 544, 0.5, animationtype2, 0);
	t_bg7.tween('_height', 25, 0, animationtype2, 2);
	t_bg8.tween('_y', yKo+175, 1, animationtype2, 2);
	t_bg8.tween('_x', xKo, 1, animationtype2, 2);
	t_bg8.tween('_width', 420, 0.5, animationtype2, 0);
	t_bg8.tween('_height', 25, 0, animationtype2, 2);
	t_bg9.colorTo(0xFFFFFF, 1, animationtype2);
	t_bg9.tween('_y', yKo+215, 1, animationtype2, 2);
	t_bg9.tween('_x', xKo, 1, animationtype2, 2);
	t_bg9.tween('_width', 155, 0.5, animationtype2, 0);
	t_bg9.tween('_height', 25, 0, animationtype2, 2);
	t_bg10.colorTo(0xCCCC00, 1, animationtype2);
	t_bg10.tween('_y', yKo+215, 1, animationtype2, 2);
	t_bg10.tween('_x', xKo+170, 1, animationtype2, 2);
	t_bg10.tween('_width', 41, 0.5, animationtype2, 0);
	t_bg10.tween('_height', 25, 0, animationtype2, 2);
}
firstmove();
///////////////////////////////////
function beweg1() {
	for (var x = 1; x<=10; x++) {
		var xwert:Number = randRange(-2000, +2500);
		var ywert:Number = randRange(+1000, -1500);
		this["t_bg"+x].tween('_y', ywert, 1, animationtype2, 4);
		this["t_bg"+x].tween('_x', xwert, 1, animationtype2, 4);
		//this["t_bg"+x].tween('_width', ywert, 0.5, animationtype2, 2);
		this["t_bg"+x].tween('_height', 25, 0, animationtype2, 4);
		this["t_bg"+x].alphaTo(0, 2, animationtype2, 2, onEnd);
	}
}
/////////////////////////////////// ON END
function onEnd() {
	createmcs1();
	firstmove();
}
Würde mich über Antworten sehr freuen.
Vielen Dank,
KD
KD* ist offline   Mit Zitat antworten
Alt 20-05-2006, 08:49   #2 (permalink)
¿
 
Registriert seit: Sep 2005
Beiträge: 86
Damit die anderen MCs über den generierten liegen machst du einfach eine neue Ebene an unterster Stelle, legst dort einen leeren MC ab und generierst deine MC da drin.
o-nyx ist offline   Mit Zitat antworten
Alt 20-05-2006, 09:25   #3 (permalink)
KD*
derkzer
 
Registriert seit: Jan 2004
Beiträge: 30
Das ist schon sehr hilfreich, werde ich gleich mal austesten! Vielen Dank o-nyx!!
KD* ist offline   Mit Zitat antworten
Alt 22-05-2006, 23:13   #4 (permalink)
KD*
derkzer
 
Registriert seit: Jan 2004
Beiträge: 30
Dreh den Script hin und her und komm nicht dahinter an was diese Verschiebung liegen könnte... Vll noch jmd ne Idee?!

KD
KD* ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an



Alle Zeitangaben in WEZ +1. Es ist jetzt 20:12 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele