|
From: Arielle on 4 Apr 2008 04:31 Hello: I need to move one sprite to a specific amount (200 pixel, for example) in one specific time (1,5 seconds for example). Can you help me, please? Many thanks
From: Rob Dillon on 4 Apr 2008 08:24 Do you want the sprite to move incrementally over the period of 1.5 seconds? Or do you want to wait 1.5 seconds before the sprite moves 200 pixels? This will do the first. If you want the sprite to move in a different direction change the + to - or use the locV instead of the locH value to change. property thisSprite property eachStep property totalSteps property counter on beginSprite me thisSprite = me.spriteNum eachStep = 200 / (_movie.frameTempo * 1.5) totalSteps = _movie.frameTempo * 1.5 counter = 0 end on exitFrame me counter = counter + 1 if counter <= totalSteps then sprite(thisSprite).locH = sprite(thisSprite).locH + eachStep end if end
|
Pages: 1 Prev: Loc carrying over between sprites in same channel Next: Two Random Points |