1 Reply Latest reply on Apr 12, 2011 11:38 AM by chiedozi

    flex 4.5 hero - navigator.activeView.height is updated after the listener StageOrientationEvent

    pol2095 Level 1

      Hello,

       

      when the phone's orientation change, navigator.activeView.height is updated after the listener StageOrientationEvent, how to change this ?

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark" title="Test" initialize="comp(event)">
              <fx:Script>
              <![CDATA[
              public function comp(e:Event):void {
                      systemManager.stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, orientationChangeHandler);
              }
              public function orientationChangeHandler(event:StageOrientationEvent):void {
                      are.text=String(this.navigator.activeView.height);
              }
              public function handleClick():void {
                     are.text=String(this.navigator.activeView.height);
              }
              ]]>
              </fx:Script>
          <s:VGroup>
                      <s:TextArea width="400" id="are"/>
                      <s:Button id="button1" label="Click here!" width="100" fontSize="12" click="handleClick();"/>
          </s:VGroup>
      </s:View>

       

      thanks