In ActionScript 3.0, the frame event model has been changed from the ActionScript 2.0 version quite a bit. In ActionScript 2.0, if you wanted to perform a task every time you entered a frame, you would type
onEnterFrame = function(){
trace("Do Something");
}
In ActionScript 3.0, you must use an event listener format to perform a frame event. For example…
addEventListener(Event.ENTER_FRAME,myFunction);
function myFunction(event:Event) {
trace("Do Something");
}
It’s a little more complicated than the old way, but ActionScript 3.0 opens up a whole new world of programming possibilities.
Recent Comments