Flash & ActionScript3: send Event from custom class

Trabla: Flash & ActionScript3 -  send Event from custom class


Solving:

 import flash.events.*;

public class MyClass extends EventDispatcher {

  private var _completeEvent:Event = new Event ( Event.COMPLETE );

  public function MyClass(){
      //constructor
  }


 public function doSomething(){
    // Doing something ...
    dispatchEvent( _completeEvent );
 }

}

No comments:

Post a Comment