stage.stageWidth workaround IE


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. stop();
  2.  
  3. // this extra step is a needed workaround, for the " stage.stageWidth not reported correctly in IE7 " bug.
  4.  
  5. addEventListener(Event.ENTER_FRAME, added);
  6.  
  7. function added(e:Event):void
  8. {
  9. if (stage.stageWidth != 0)
  10. {
  11. gotoAndStop(2);
  12.  
  13. removeEventListener(Event.ENTER_FRAME, added);
  14. }
  15. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.