PDA

View Full Version : animation question, plz~~somebody help me~~


till...
06-25-2004, 02:24 AM
I'm trying to animate multiple objects' _x with one button, if the first object's actionscript is _root.tagX = 300, then what should the others be??

is it _root.instance name.tagX = something ?

or is there a better way to do something like this, please help, thx thx thx....

i'm using Flash 5 by the way...

ssipse
06-26-2004, 10:24 AM
wha?

Ruben
06-27-2004, 11:14 AM
somebutton.onRelease = function(){
if (movieclip1._x == 300){
movieclip2._y = 150;
}
}

?????

Sorry til, not really getting what you're trying to say, think I'm not the only one...Is this what you want?

:confused: - Ruben

ssipse
06-27-2004, 09:25 PM
Ruben, he's using Flash 5..

Ruben
06-27-2004, 11:59 PM
Oh, sorry, my mistake, the code on the button in F5 should be:

on(release){
if (movieclip1._x == 300){
movieclip2._y = 150;
}
}

:rolleyes: - Ruben

till...
06-30-2004, 07:39 AM
thx guys

but i want the movieclips to 'move' to the destination, not jump right to there.
so i have to set something on the movieclips like this right?

onClipEvent (load) {
movieclip.targX = 100;
}
onClipEvent (enterFrame) {
cX = this._x;
difX = cX - movieclip.targX;
setProperty (movieclip, _x, cX - (difX/5));
}

correct my mistakes please...
thank you for your time...

Ruben
06-30-2004, 10:24 AM
alrighty then, just typed in replybox, not tested....just so you know ;)

code on clip:
onClipEvent (enterFrame) {
if (_root.move && _x != _root.destinationX){
_x += (_root.destinationX - _x) / _root.steps;
_y += (_root.destinationY - _y) / _root.steps;
}else{
_root.move = false;
}
}

code on button:
on (release){
_root.move = true;
_root.destinationX = 200;
_root.destinationY = 200;
_root.steps = 100;
}

That should do it I guess...

:) - Ruben

till...
07-01-2004, 12:51 AM
thank you thank you thank you

that work

:D :D :D

Ruben
07-01-2004, 03:06 PM
:) - Ruben