0 Replies Latest reply on Apr 25, 2012 8:19 AM by MrCodeghost

    How to detect correct screen size in landscape on iPhone

    MrCodeghost Level 1

      I have a Flex app that has a custom AS3 component. The AS3 component creates a Video object and attaches is via addChild.

      I have tried instantiating the video in various manners (Capabilities / Screen.mainscreen / etc.). I can't reference the stage object as it is null at the point the AS3 object is instantiated.

      The app is starting up in landscape with autoOrients set to false.

       

      In Android all the above methods work fine, correctly sizing the video to the screen. However, on the iPhone the Video size is set as though the screen were in landscape (i.e. thin and long, cutting off the top and bottom of the video object and leaving a white gap the right. If I reverse the measures it obviously sizes correctly, but this relies on me checking the device type, which seems wrong.

       

      Does anyone know the correct way to do this?

       

      Thanks.