Flash CS3 Tutorial
This Flash CS3 Tutorial is on creating Repeat Actions. You may not fully understand at this time what Repeat Actions are, but they are The Foundation for Flash Gaming. This is a very important Flash Tutorial if you are interested in Flash Gameing
Flash CS3 Tutorial, link list
Here is a list of the Flash CS3 Tutorials I recommend
- Repeat Actions
- Here is the link to the complete Flash Tutorial on Repeat Actions. This Flash CS3 Tutorial includes the Source Files.
- FrenchSquared.com
- Here is a link to my home page. Check it out. I have Free Flash Games, along with the FREE Flash CS3 Tutorials.
- Flash Tutorial List
- Here is a list of all my Flash Tutorials.
- F2-4Kids
- Check out this great educational site designed for kids. My tutorials teach you everything you need to make a site like this one.
Other Flash CS3 Tutorials by Gordon FRench
Flash CS3 Tutorials
So, if you like what you have scene from me in regards to Flash CS3 Tutorials, then please feel free to keep an eye on my Flash CS3 Tutorials RSS Feed.
Fetching RSS feed... please stand byBooks on Flash CS3 Tutorials
Flash Tutorial, ActionScript 3.0
Flash CS3 Tutorial on Making Event Listeners
Flash CS3 Tutorial Repeated Actions

At times in Flash and ActionScript you will want to perform an action continuously. You may need to see if a movie is playing or if an object has hit another object. Or perhaps you want to move an object from point a to b.
This Flash CS3 Tutorial covers how to do just that.
The Event.Enter_Frame is the line you will need. Event.ENTER_FRAME tells flash to do this or that for every frame in the movie. This continues action will happen even if the time line is stopped. It will happen as often as you frame rate is set for. Meaning if you run the movie at 30 frames per second then the Event.ENTER_FRAME will happen 30 times per second.
Full Tutorial Here
ENTER_FRAME
Once again in this Flash CS3 Tutorial some of the work is done for you. In This Flash CS3 Tutorial I have created an image of a car and the background of the street. I already labeled the image of the car as car_mc. You just need to add the ActionScript 3.0. Select the first frame on the actions layer and create a new function using Event. Add the code from the example. Go ahead and press Control-Enter to see the movie in action.
function drive (yourEvent:Event):void {
car_mc.x += 5
};
car_mc.addEventListener(Event.ENTER_FRAME, drive)
In the example I added an if statement thst checks to see if the car has movied 600px. Since the stage is 700px, the car should stop at the edge of the stage. You can change the 600 to any number you want. I left it less then the stage width so you could actually see the car stop.
Timer
ENTER_FRAME is not the only way to coninually control an object. You can also create a timer. So lets move the Plane with a timer. This code is alittle different in that you will need to create a variable. You create a varaible with the var tag. So in this case you are going to create the varible yourTimer. You are then going to Data Type it as a Timer, because it is part of proper coding. Next you are going to set the constructors of the timer. The constructor takes two parameters, the first is a number in milliseconds and the second number is the number of intervals. You do not have to use the second parameter, but without it the timer will run intil you stop it. That means the timer you just created will be called every 10 milliseconds, and it will be called 170 times. 170 is just long enough to get the plane off the stage. You will want to increase it because the shadow is still on the stage. I stopped it a little sooner so you could actually see the plane stop. The rest of the code is basically the same. I added plane_mc.y -= 1 so the plane would not fly straight across the stage. You can play with these number as you wish to control the speed and distance the objects travel.
var yourTimer:Timer=new Timer(10,170)
yourTimer.start();
function fly (yourEvent:TimerEvent):void {
plane_mc.x -= 5
plane_mc.y -= 1
};
yourTimer.addEventListener(TimerEvent.TIMER, fly)

There are a few other event handlers that you should be aware of, but I will let you explore on your own.
updateAfterEvent - you can use this to force flash to refress the display if you object is moving faster then the frame rate. updateAfterEvent, will result in smoother motion.
TimerEvent.TIMER_COMPLETE - you can trake the end of the timer with the TIMER_COMPLETE event handler, thus being able to start another action.










