Flash ActionScript Tutorial : Get Current frame Number
Sometimes this is very important to know how to get the current frame number of Flash Movies. This allow us to control the Flash animation much easier.
Flash Tutorial Content:
For some Flash Movies, it may need to know the current frame number of Flash Movie. This allow us to control the Flash animation in a better and much easier way. In this Flash ActionScript tutorial, we write a very simple function so that the current frame of Flash Movie can be tracked easily.
The complete Flash Movie is shown as above, you may try how it works before you start this Flash ActionScript tutorial.
Flash ActionScript Codes:
// Add Event Listener to stage
addEventListener(Event.ENTER_FRAME, countFrame);
function countFrame(evt:Event) {
output_txt.text = ("The Current Frame Number is now: " + this.currentFrame);
}
Download Flash Source File:
Remarks:
This Flash ActionScript tutorial shows how to obtain or get the current frame number of Flash Movie.