Posted By

sidneydekoning on 06/04/09


Tagged

fix resize refresh ie6


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

szoftverhiba
quan


Stage Resize Refresh IE 6 Bug Fix


 / Published in: ActionScript 3
 

  1. /*
  2. Use if your objects position is based on stage.stageWidth and stage.stageHeight.
  3. When refreshed it traces 0 for stageWidth and stageHeight
  4. */
  5. function startApp():void {
  6. // make it call an function on resize
  7. stage.addEventListener(Event.RESIZE, resizeHandler);
  8. // call that resizeHandler again (for browsers like IE 6)
  9. resizeHandler();
  10. }
  11.  
  12. function resizeHandler(e:Event = null):void {
  13. // check if the Height and Width is bigger than zero and act accordingly.
  14. if ( stage.stageHeight > 0 && stage.stageWidth > 0 ) {
  15. // safe area. Do normal resize
  16. }
  17. }

Report this snippet  

You need to login to post a comment.