|
var timeClock:Timer = new Timer(100); 12 Free Online Quiz Creators for Teaching Online Last post by: Sunnyme Date: 01.10.2009 06:26:27
After a bit of play, I've gotten “if statements” and the sort to work. In short, the setInterval function creates it's own “little world” within Flash, and only the code within setInterval will update at the interval you set (in this case, every second - hence the variable 'timer' is increased by 1 every second). In order to use this timer for something more than just numbers increasing, you'll need to add extra code into the setInterval function. Growing on Awesty's code, you could do this (NOTE: I'm counting up, not down):
1. Open up a new Flash Document. Make 2 layers. Name one actions and the other timer. First we will add all of the objects and then throw all of our actionscript together. *Note: This tutorial was written using flash mx 2004 with ActionsScript 2.0 strict variable typing. It is not required by flash, but it is a very good programming practice and will help flash out immensely with debugging your movie if you ever have errors. If you are using Flash mx please just remove all of the datatypes like :Number or :String. Add him a Instance name "count_down" (It's important to don't change this name, or you have to change name in code later) This tutorial was written for the Flash Designer software, which allows you to create flash animations in a much easier way than by using Macromedia Flash. You may get Flash Designer here. |
| www_._ja___v___a_2___s___.c_o___m__ | Contact Us |
| Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
| All other trademarks are property of their respective owners. |