Today I, Jason Gordon, created my first production flash applet. It's very simple, but the applet is a great beginner's example for how to create a timeline effect animation and use basic action script. Below I'll describe the application in terms of its component parts.
I. Animations
First I created 3 textfields and entered a word in each one, "LIVE.", "RIGHT.", "NOW.", respectively.
Then, for each textfield, I inserted a timeline effect on it. The effect was a fade in transition lasting 24 frames (1sec @ 24fps).
I then lined up all the frames so that live animated, when finished, right animate, and when finished now animated.
On the last frame for each of these layers I added a keyframe and to this keyframe i attached an actionscript action. The code was just stop();
II. Countdown
The countdown was a bit less tricky, honestly. I've done countdowns in code a few times in the past, so the code part wasn't new. Attaching the actionscript was a trick. I didn't realize I just had to click the stage somewhere and start typing! Man..tricky son of bitch you are, flash.
For the countdown I created a layer and added 2 textfields to it. In the first textfield i typed "Countdown: ". The second I made a dynamic textfield, and named it result. Below is the actionscript I wrote to implement the countdown:
Submitted by Mark (not verified) on October 28, 2009 - 10:20pm.
I found this to be really useful in learning to create a reliable countdown timer. One thing i was wondering though is how would you use it to trigger an event, or a message for example when it hits 0. I figured just using an if statement that compares the showStart.time == now.time would do the trick, but i don't seem to be getting any output using this method ? Any ideas.
Thanks for the code tips by the way :)
M
Let go of your attachment to being right, and suddenly your mind is more open. You're able to benefit from the unique viewpoints of others, without being crippled by your own judgment.
Thanks Mark! As to your
Thanks Mark!
As to your question about triggering an event...I'm not quite sure yet. When I find out I'll modify the post here with an update on what I found.
I found this to be really
I found this to be really useful in learning to create a reliable countdown timer. One thing i was wondering though is how would you use it to trigger an event, or a message for example when it hits 0. I figured just using an if statement that compares the showStart.time == now.time would do the trick, but i don't seem to be getting any output using this method ? Any ideas.
Thanks for the code tips by the way :)
M