Using screen orientation APIs for smartphone with Adobe Air

07 Jun
StageOrientationEvent.ORIENTATION_CHANGING, onOrientationChanging );
stage.addEventListener( StageOrientationEvent.ORIENTATION_CHANGE,
onOrientationChange );
function onOrientationChanging( event:StageOrientationEvent ):void
    trace("The current orientation is "
       + event.beforeOrientation + " and is about to change to " +
       event.afterOrientation );
function onOrientationChange( event:StageOrientationEvent ):void
    trace("The orientation was " + event.beforeOrientation + " and is now " + event.afterOrientation );

Read More

Posted by on June 7, 2011 in Action Script3, Adobe Air, iPhone


2 responses to “Using screen orientation APIs for smartphone with Adobe Air

  1. sid

    June 28, 2011 at 10:02 am


    I have started developing Adobe AIR 2.6 applications for iphones and android mobiles.
    Everything works generally but I have designing issues.
    Like I have developed one screen perfectly for iphone 3Gs and on device it also looks exactly same.
    But when I run run that application on iphone 4G everything gets shrink.
    Means my application gets scaled. I came to know that iphone 4 uses ratina display kind of thing so resolution gets double that’s why this scaling occurs.

    So do you help me to get idea how to design the fluid layout that looks the same on all devices.

    Any hint or reference is appreciated.

    • flashpri

      June 29, 2011 at 12:39 am

      Hello Bhavin,

      If you use flash platform than you have to use 640 x 960 OR 960 x 640 ( height and width) for ratina display

      if you use xCode than

      You need to use 2x image for 4G i mean you have to use double size of image for that.
      for e.g if your button image is 80 x 50(mybutton.png) than you must use 160 x 100 (mybutton@2x.png)

      So nothing to change in code, you need to add @2x.png images in your aaps


      Just import this @2x.png images in your aaps with right click on references folder than click on add existing files…
      and selected all @2x.png files. 0 line code for this.
      And build it.. Enjoy dear.

      If you hv any problem than contact me. I will help you… my cell +91 9099795049


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: