Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8309613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:10:36+00:00 2026-06-08T19:10:36+00:00

I’m programming an app for iOS and Android with AIR 3.3/Flash CS5.5. Now I

  • 0

I’m programming an app for iOS and Android with AIR 3.3/Flash CS5.5. Now I got the problem, that the app won’t resize on iOS device (testing on ipod touch 4).

Here’s my code:

        public function Main() {
            this.addEventListener(Event.ADDED , Init, false, 0, true);
        }

        private function Init(e:Event) {
            this.removeEventListener(Event.ADDED , Init);

            stage.scaleMode = StageScaleMode.NO_SCALE;
            stage.align = StageAlign.TOP_LEFT;

            stage.addEventListener(Event.RESIZE , Resize, false, 0, true);
        }

        private function Resize(e:Event) {
            stage.removeEventListener(Event.RESIZE, Resize);

            var stageheight = Math.min(stage.fullScreenHeight, Screen.mainScreen.visibleBounds.height);
            var stagewidth = Math.min(stage.fullScreenWidth, Screen.mainScreen.visibleBounds.width);

            stage.stageHeight = Math.min(stagewidth, stageheight);
            stage.stageWidth = Math.max(stagewidth, stageheight);


            scaleFactor = stage.stageHeight / APP_ORG_HEIGHT;

            NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;
        }

It works on Android devices, but not on my test device.

Here my xml settings:

  <initialWindow>
    <systemChrome>standard</systemChrome>
    <transparent>false</transparent>
    <visible>true</visible>
    <fullScreen>true</fullScreen>
    <aspectRatio>landscape</aspectRatio>
    <renderMode>gpu</renderMode>
    <autoOrients>false</autoOrients>
  </initialWindow>
  <android>
    <manifestAdditions>
      <![CDATA[<manifest android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
</manifest>]]>
    </manifestAdditions>
  </android>
  <iPhone>
    <InfoAdditions>
      <![CDATA[<key>UIDeviceFamily</key><array><string>1</string></array><key>UIPrerenderedIcon</key><true/><key>UIApplicationExitsOnSuspend</key><true/>]]>
    </InfoAdditions>
    <requestedDisplayResolution>high</requestedDisplayResolution>
  </iPhone>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T19:10:38+00:00Added an answer on June 8, 2026 at 7:10 pm

    Try changing to

        public function Main() {
            if(stage) Init();
            addEventListener(Event.ADDED_TO_STAGE, Init);
        }
    
        private function Init(e:Event = null) {
            if(e != null) this.removeEventListener(Event.ADDED_TO_STAGE, Init);
            ...
    

    You might not be recieveing the added event because by the time the event listener is hooked up, the DisplayObject may already be on the stage. In that case, its better to conditionally test if stage is available. If it is, then go ahead and do the work. Otherwise, wait until the object has been added to the stage.

    I would also add the Event.RESIZE event handler before changing the stage scale mode and stage alignment.

    And finally, you might be receiving more than one resize event during application initialization. But the way your code is written right now, it’ll only do it for the first, which might not be the “final” size. You might want to rewrite your resize handler so that it can be called multiple times — which it mostly looks okay.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.