Skip to main content
Known Participant
July 9, 2009
Question

convert onEnterFrame Event Handler AS2 code into AS3

  • July 9, 2009
  • 2 replies
  • 1075 views

My code of AS2 is given below. I do not know what event handler type is used and which event handler is used in AS3.

onEnterFrame = function(){

   //

};

This topic has been closed for replies.

2 replies

robdillon
Participating Frequently
July 9, 2009

this.addEventListener(Event.ENTER_FRAME,onEf);

// "this" references the movie itself, you can also use "stage" or the instance name of an object on the stage

// look up addEventListener in the online help. This method takes two arguments, the event that you want to "listen" for and the name of the function to execute when the event occurs.

// the function that will be called when the event occurs. It takes one argument that corresponds with the first argument of the addEventListener method.

function onEf(event:Event):void {

}

Ned Murphy
Legend
July 9, 2009

objectName.addEventListener(Event.ENTER_FRAME, Handler);

function Handler(evt:Event):void {

     ...

}