PDA

View Full Version : Flash/Actionscript help



Meanies
07-07-2009, 09:59 PM
I need a quick bit of help..

I want the txtLifeLost part to disappear after 5 seconds from when it appears but can't work out how



if(mcBall._y >= Stage.height-mcBall._height){
lives --;
txtLifeLost.text = 'Lives remaining: '+lives;
ballXSpeed *= 0;
ballYSpeed *= -1;
mcBall._x = 280;
mcBall._y = 354.4;
mcPaddle._x = 252;
mcPaddle._y = 362;
}
Thanks!

MrPinkPanther
08-07-2009, 07:11 AM
Presumably you are working at 12FPS. Firstly create a new Movieclip called Life_Lost and create one giant long frame from 0-60 frames, in this frame put your txtLifeLost. Create a blank frame on the 61st frame and in the Actions put "Stop();".

So when you loose a life you can say GotoAndPlay(1); and it will stay up for 60 seconds.

Meanies
08-07-2009, 04:55 PM
Thanks!
I'll try it out over the weekend and try it out:D
btw, it's at 24fps if that'll make any difference?

Blob
08-07-2009, 05:02 PM
Thanks!
I'll try it out over the weekend and try it out:D
btw, it's at 24fps if that'll make any difference?

Just do

the frames per second x amount of seconds you want it up there

Meanies
08-07-2009, 05:05 PM
Just do

the frames per second x amount of seconds you want it up there
Okay, thanks :D
+rep to both too!

MrPinkPanther
08-07-2009, 05:34 PM
120 Frames :). Thats how I always do timers in Flash anyway.

Want to hide these adverts? Register an account for free!