2 Replies Latest reply on Dec 20, 2011 10:17 AM by Metaboy

    Flash CS5.5+AIR 2.7(iOS)+Flex SDK 4.5.1 = StageOrientationEvent missing?

    zoomfreddy

      Hi, I'm in the process of trying several old and new apps publishing them for iOS on iPad, everything seems to be working very good, with some codes needing some optimizations of course.

       

      But maybe I found a bug, or I'm doing something wrong?, let's see:

       

      I'm using Flash CS 5.5 and followed the instructions to update manually AIR 2.6 to AIR 2.7 found here: http://kb2.adobe.com/cps/908/cpsid_90810.html

       

      After that I tried to publish some apps, all worked fine.

       

      Some components (minimal comps from www.bit-101.com) rely on [Embed] to use fonts so I updated Flex to 4.5.1 and updated the path to the SDK in Flash Preferences

       

      Everything working fine so far but...

       

      I have this app where I'm using some knobs from minimal comps and added this stage orientation code (the full code works fine when not using Flex SDK):

       

      if (appOrientation=="landscape") {

           if (startOrientation == StageOrientation.DEFAULT || startOrientation == StageOrientation.UPSIDE_DOWN) {

                stage.setOrientation (StageOrientation.ROTATED_RIGHT);

           }

      }

       

      so far so good, everything works fine on the iPad but when I try to use this code:

       

      stage.addEventListener (StageOrientationEvent.ORIENTATION_CHANGING, orientationChangeListener);

       

      function orientationChangeListener (event:StageOrientationEvent) {

           if (appOrientation=="landscape") {

                if (event.afterOrientation == StageOrientation.DEFAULT || event.afterOrientation == StageOrientation.UPSIDE_DOWN) {

                     event.preventDefault ();

                }

           }

      }

       

      The compiler throws this error:

       

      1046: Type was not found or was not a compile-time constant: StageOrientationEvent.

       

      Is there something else I need to update in Flex 4.5.1 SDK to make it work, or this is a bug in the SDK?

       

      Thanks for your help!