PDA

View Full Version : tween class


booly
09-22-2009, 05:00 PM
Hi, i'm trying to use the class in Flash to move a MC in my movie. I used the tutorial from monkeyflash for this and altered it a bit and i'm beginning to understand how it works. Now I want it to start again after it resets, does anyone know how I can trigger that?
Thanx for helping.
Mark

dance2dark
09-23-2009, 01:09 AM
Start what again?? The tween? Are you looking for it to loop or be applied on an event?

booly
09-23-2009, 09:05 AM
I just want it to loop. I have another mc with a normal animation in it playing. I tryed to restart when this animation reaches the end with _root.gotoandplay(scene 1,) but then the scripted animation won't work.
Thanks

dance2dark
09-23-2009, 11:45 AM
Ok, if you are trying to loop a tween, my thoughts are the following:

Create variables and functions for the tween:

StartPositionNumber:Number = whateverStartPositionIs
EndPositionNumber:Number = whateverEndPositionIs
function tweenMovieClip();
Event function for ENTER_FRAME to check movieClip positioning


Create a conditional statement that can be calculated with the event of ENTER_FRAME that can keep checking for the movieClip that is tweening == EndPositionNumber, call the function to tween again. Does this make any sense?

booly
09-23-2009, 06:19 PM
No i'm afraid not. I'm kinda new to actionscript. I used this tutorial http://monkeyflash.com/tutorials/using-the-tween-class/ and changed the code a bit with trial and error and it works (i needed it to move over the x and y axis instead of only x). The only thing is that it has to loop but it seems that is a bit harder to understand. I thought it was just a question of calling another standard class thing like yoyo or something.