Listeners for the Event.RESIZE event must be registered with Flash Player's Stage instance, : Event « Development « Flash / Flex / ActionScript






Listeners for the Event.RESIZE event must be registered with Flash Player's Stage instance,

 
package {
  import flash.display.*;
  import flash.events.*;

  public class Main extends Sprite {
    public function Main(  ) {
      stage.scaleMode = StageScaleMode.NO_SCALE;
      stage.addEventListener(Event.RESIZE, resizeListener);
    }

    private function resizeListener (e:Event):void {
      trace("Flash Player was resized");
    }
  }
}

        








Related examples in the same category

1.Handling Events: a simple application that draws successive random lines
2.Event Listener Priority
3.Add Event listener
4.Responding to Event.ACTIVATE and Event.DEACTIVATE
5.The Event.MOUSE_LEAVE Event
6.Responding to Event.RESIZE.
7.Preventing Default Event Behavior