1 Reply Latest reply on Jun 10, 2011 1:56 PM by analogscott

    maximize and restore down on resize

    pm_on_mac

      Hi,

       

      I'm trying to figure out what I'm doing wrong but I'm stuck!

       

      In my Flash code, I added a section to react on Resize, It looks like that:

       

      ............
      myListener = new Object();
      myListener.onResize = onScreenResize;


      Stage.addListener(myListener);


      function onScreenResize():Void
      {
             
      trace("I'm at resize");
      trace("Stage.height=" + Stage.height );
      trace("Stage.width =" + Stage.width );

      ..........

      }

       

      It works fine every time I resize the browser, but, pressing "maximize" and/or "restore down" browser's buttons,

      it resizes not as doing it manually, I mean, the result is an image shorter or longer but actually that

      not fits the browser like doing manually.

       

      Using "maximize" and "restore down", the "OnScreenResize" is called, the trace stuff is executed but it seems it does

      not execute the remaining code below the trace to resize as it used to do when resizing manually.

       

      For example, lets press "restore down" on my browser: the "OnScreenResize" is called and the Stage.height/width are

      600x750 but the movie is wrongly resized. At this point, it's enough to enlarge a little bit the window manually up to

      601x750 (i.e.) and the same code is executed but now the resizing is ok. My movie is fitting perfectly the window browser.

       

      The behaviour is the same using Firefox or IE.

       

      I'm pretty new to Flash so I'll appreciate any help!

       

      Thanks

       

      Ciao

       

      Paolo