Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The answer above did not work for me, because on iOS the preventDefault no longer works.</p> <p>For anyone who just still isn't having good luck... Here's what I did.</p> <p>I wanted:</p> <p>Ipad &amp; All Android Tablet devices to be able to Portrait or Landscape and auto-rotate in any direction</p> <p>Iphones, Ipods, &amp; All Small Screen Devices to be forced Landscape (or maybe in your case you want forced portrait).</p> <p>I Did:</p> <p>IN my -app.xml:</p> <pre><code>&lt;aspectRatio&gt;any&lt;/aspectRatio&gt; &lt;autoOrients&gt;true&lt;/autoOrients&gt; </code></pre> <p>In Actionscript:</p> <pre><code> var screenDPI:Number = Capabilities.screenDPI; var resolutionX:Number = Capabilities.screenResolutionX; var resolutionY:Number = Capabilities.screenResolutionY; var numDiagonalDistance:Number = Math.round(Math.sqrt((resolutionX*resolutionX)+(resolutionY*resolutionY))); var numDiagonalInches:Number = numDiagonalDistance/screenDPI; if(numDiagonalInches&lt;6){ MainData.SMALL_DEVICE=true; }else{ MainData.SMALL_DEVICE=false; } if(MainData.SMALL_DEVICE){ this.stage.setAspectRatio(StageAspectRatio.LANDSCAPE); } </code></pre> <p>Though I guess you could easily put StageAspectRatio.PORTRAIT or even use the reverse logic to logic ipads only or something. Good Luck!</p> <p>EDITED: I'm actually editing this because even this method still has problems. You'll get landscape but its not always the landscape oriented to how you're holding the device...</p> <p>EDITED AGAIN (2-27-2014): Turns out if I included -swf-version 23 (now with AIR 4.0) this problem is finally solved. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload