Skip to main content
Inspiring
May 26, 2013
Question

AIR BUG: setting autoOrients = false... no longer works on launch! (iOS)

  • May 26, 2013
  • 1 reply
  • 2840 views

Newly discovered problem with AIR and iOS.... autoOrients is no longer working when launching an iPhone app.

Specifics:

1. Allow auto orientation via app descriptor (I'm doing via Flash Pro CS6).

2. In "main.as", progromatically set autoOrients  = "false." (I do this for iPhone, as having orientation set to true in app descriptor allows multiple iPad launch orientation scenarios)

3. PROBLEM:  If iPhone is held in landscape mode on launch, app will auto rotate to landscape even with autoOrients set to false. (Portrait should be the default mode for iPhone).

Never had this problem with autoOrients before. Can anyone confirm?

Tried 3.6, 3.7. iOS 5 for iPhone 4S & iOS 6 for iPad.

This topic has been closed for replies.

1 reply

gtrAuthor
Inspiring
May 28, 2013

So... basically this gist is: if you have autoOrients allowed, you will not be able to call "stage.autoOrients = false" during initial app startup. It does nothing. I did some testing this weekend, and while changing the call in my code to "this.stage.autoOrients = false" does trace out as "autoOrient = false", the device will still have been allowed to rotate to landscape during launch.

Can't be sure if this is a new bug, or if it was like this all along and I just never tried launching my iPhone app with the device rotated to landscape...

Adobe Employee
May 28, 2013

The initial or the orientation of the app is decided by the value of aspectratio and autoorients tag in the application descriptor. By the time, actionscript code is hit, the runtime has already figured out the launch orientation and hence you are facing such issue. If you want your app to launch in portrait only mode, set aspectRatio tag to portrait.

Regards,

Nimit

gtrAuthor
Inspiring
May 28, 2013

If you want your app to launch in portrait only mode, set aspectRatio tag to portrait.

This is a problem if you want to create a universal iOS apps, since many iPhone apps are portrait only, while iPads tend to be held in landscape.

However, my app allows full autoOrients, all aspect ratios, but I wanted the iPhone to be portrait only on launch and then enable rotation later on... Any ideas?