Techblog

Tech Blog

Our latest geek adventures!

13 March SWF and Internet Explorer

After some diggin’ I finally figured out why Internet Explorer didn’t display my SWF movie. The width and the height of my movie are related to the width and height of the Stage. It seems that in IE the Stage isn’t available in the first frame. Therefore the movie has to wait a frame before it can acces the Stage properties.

public function Application() {
  addEventListener( Event.ENTER_FRAME, onEnterFrame );
}
private function onEnterFrame( pEvent:Event ) : void {
  removeEventListener( Event.ENTER_FRAME, onEnterFrame );
  setWidth( stage.stageWidth );
  setHeight( stage.stageHeight );
}

Tags: ,

3 Responses to “SWF and Internet Explorer”

  1. admin Says:

    true, ga er nooit van uit dat ’stage’ er al ‘is’.

  2. Marcus Says:

    Thank you! I have been going crazy for the past day trying to figure out WHY ie just couldn’t read the stage size!

  3. Gert-Jan Says:

    You’re welcome ;-)

Leave a Reply