Code Snippets are prewritten snippets of code that you can insert into your movie. They always have to be modified, but they are a good way to get started with code.


/* Enter Frame Event
Executes the function fl_EnterFrameHandler defined below each time the playhead moves into a new frame of the timeline.
Instructions:
1. Add your custom code on a new line after the line that says "// Start your custom code" below.
The code will execute when the playhead moves into a new timeline frame.
*/
addEventListener(Event.ENTER_FRAME, fl_EnterFrameHandler);
function fl_EnterFrameHandler(event:Event):void
{
//Start your custom code
// This example code displays the words "Entered frame" in the Output panel.
trace("Entered frame");
// End your custom code
}
addEventListener(Event.ENTER_FRAME, frames);
function frames(e:Event):void
{
star.rotation++;
}
Assuming the frame rate (FPS: frames per second) is 24, the enter frame event occurs 24 times per second even if you have just one frame in the movie.