Skip to main content
Inspiring
June 19, 2013
Answered

Full screen in AS3 - Air

  • June 19, 2013
  • 2 replies
  • 8940 views

Hi I am trying to the get my andoid app to show up full screen. But this doesnt work.

My stage is 480x800

And this is the code that I attempted to use:

package

{

          import flash.display.MovieClip;

          import com.greensock.*;

          import com.greensock.easing.*;

          import flash.events.MouseEvent;

          import flash.system.Capabilities;

          import flash.display.StageDisplayState;

          import flash.display.StageScaleMode;

          import flash.display.StageAlign;

          public class mainclass extends MovieClip

          {

                    private var holder:holder_mc = new holder_mc  ;

                    private var btn:BTN = new BTN  ;

                    private var side1:side_mc = new side_mc  ;

                    private var side2:side_mc = new side_mc  ;

                    public function mainclass()

                    {

                              super();

                              stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;

                              stage.showDefaultContextMenu = false;

                              stage.scaleMode = StageScaleMode.NO_SCALE;

                              stage.align = StageAlign.TOP_LEFT;

 

                              holder.width = Capabilities.screenResolutionX;

                              holder.height = Capabilities.screenResolutionY;

                              addChild(holder);

                              trace(holder.width)

                              trace(stage.stageWidth)

                              btn.x = 250;

                              btn.y = 300;

                              holder.addChild(btn);

                              side1.width = holder.width / 2;

                              side1.height = holder.height;

                              side1.x =  -  side1.width;

                              side1.y = 0;

                              holder.addChild(side1);

                              side2.width = holder.width / 2;

                              side2.height = holder.height;

                              side2.x = holder.width + side1.width;

                              side2.y = 0;

                              holder.addChild(side2);

                              //btn.addEventListener(MouseEvent.CLICK, closedoors);

                    }

                    private function closedoors(e:MouseEvent):void

                    {

                              btn.removeEventListener(MouseEvent.CLICK, closedoors);

                              TweenLite.to(side1, .8, {x:0, ease:Bounce.easeOut});

                              TweenLite.to(side2, .8, {x:side2.width, ease:Bounce.easeOut});

                    }

                    private function opendoors():void

                    {

                              TweenLite.to(side1, .8, {x:-side2.width, ease:Bounce.easeOut,delay:.3});

                              TweenLite.to(side2, .8, {x:stage.stageWidth, ease:Bounce.easeOut,delay:.3,onComplete:addList});

                    }

                    private function addList():void

                    {

                              btn.addEventListener(MouseEvent.CLICK, closedoors);

                    }

          }

}

Any help is much appriciated.

Thx pavel

This topic has been closed for replies.
Correct answer HanerCamilo

If you still need your answer:

 

After a search in some forums to solve my question (similar to your) My app can use fullscreen in any "ANY" screen also if is in 16:9 or 18:9 aspect ratio. Here's my question related about yours:
https://forums.adobe.com/thread/2651175

 

Now I have the answer but I can't write there because "forums" already doesn't exist. Now is "comunity".

 

Here is the answer:

go to XML file (manifest or app descriptor), and find: <application>

Put this inside before </application>:

 

<android>
<manifestAdditions>
<![CDATA[
<manifest android:installLocation="auto">
<!-- other tags here -->
<application android:hardwareAccelerated="true">
<!-- this lets you support devices larger than 16:9 ratio -->
<meta-data android:name="android.max_aspect" android:value="2.16" />
</application>
</manifest>
]]>
</manifestAdditions>
</android>

 

It will work. I'm glad. 

2 replies

HanerCamilo
HanerCamiloCorrect answer
New Participant
September 16, 2019

If you still need your answer:

 

After a search in some forums to solve my question (similar to your) My app can use fullscreen in any "ANY" screen also if is in 16:9 or 18:9 aspect ratio. Here's my question related about yours:
https://forums.adobe.com/thread/2651175

 

Now I have the answer but I can't write there because "forums" already doesn't exist. Now is "comunity".

 

Here is the answer:

go to XML file (manifest or app descriptor), and find: <application>

Put this inside before </application>:

 

<android>
<manifestAdditions>
<![CDATA[
<manifest android:installLocation="auto">
<!-- other tags here -->
<application android:hardwareAccelerated="true">
<!-- this lets you support devices larger than 16:9 ratio -->
<meta-data android:name="android.max_aspect" android:value="2.16" />
</application>
</manifest>
]]>
</manifestAdditions>
</android>

 

It will work. I'm glad. 

New Participant
August 9, 2022

Big thanks bro, my problem solved 😀

kglad
Community Expert
June 19, 2013

what's that platform's allowFullScreenInteractive property?

pa-pavelAuthor
Inspiring
June 20, 2013

I am texting the 'app' on my galaxy s4, but would like it to run on any android in general regardless of the screen resolution.

When I simpley export an .apk file from flash woth the stage code or with out the 'app' doesnt fully fit in the screen its to small.

         holder.width = Capabilities.screenResolutionX;

                              holder.height = Capabilities.screenResolutionY;


seemed like a solution but that distorts everything.

allowFullScreenInteractive property

I found on the net as a android property to allow things to be user interactive in air at full screen.

Any advice?

kglad
Community Expert
August 4, 2013

Thank you again for your answer.

I copy the code (press F9), and i create the apk file with air 3.4 (full screen option) but nothing happened. Again it doesn't work in full screen mode. I tested it in a galaxy S3 and in a samsunf galaxy tab 2 10.1. Do you have any suggestions? Or maybe to send you the .fla file to see what is wrong?

Thank you in advance!


add this to your application descriptor file:

<fullScreen>true</fullScreen>