4 Replies Latest reply on Jul 26, 2011 3:36 PM by eegz

    Resize event too early for scrollRect on Full Screen switch

    eegz Level 1

      1. Switch to full screen.

      2. Receive resize event.

      3. Check scrollRect of viewport.

      4. ScrollRect is old value from before resize (component size is correct however).



      To duplicate use the below code.



        1. Run code

        2. Click box to go to full screen

        3. Note the size of the viewport is the value from before the resize to full screen

        4. Hit escape to leave full screen

        5. Note that viewport is actually larger than the scroller (it's still the old value from the full screen mode)



      Are there any hacks or workarounds (or did I mess something up)?




                                                          Code to demonstrate:



      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                     click="{stage.displayState = StageDisplayState.FULL_SCREEN}"
                  import mx.events.FlexEvent;
                  import mx.events.ResizeEvent;
                  protected function scroller1_resizeHandler(event:ResizeEvent):void
          <s:Scroller id="myScroller" top="10" bottom="10" left="10" right="10" resize="scroller1_resizeHandler(event)">
              <s:Group id="myGroup" clipAndEnableScrolling="true">
                  <s:Label backgroundColor="red" width="5000" height="5000" />