How to change my application to adjust the dimensions of the device?

The dimensions of my apps are 800 x 450.

The dimensions of my android devices are 540 x 960

With this of course when I installed on the device of the app appeared not implemented nationally within a window on my mobile device.

I have the updated XML code the

Now I'll show you some of my code.

  public static var gameStage:Stage;
....  

public function initApplication():void
  {
   this._game = new MovieClip;
   super.addChild(this._game);
  }
  private function initThreeBalls():void
  {
   gameStage = this._game.stage;
   var starBackGround:Stars = new Stars; // Add a background large 1200 x 3000 texture
...
}


Here's some code I found here:

var appScale:Number = 1;
var appSize:Rectangle = guiSize.clone();
var appLeftOffset:Number = 0; // if device is wider than GUI's aspect ratio, height determines scale 
if ((deviceSize.width/deviceSize.height) > (guiSize.width/guiSize.height)) 
{ 
appScale = deviceSize.height / guiSize.height; appSize.width = deviceSize.width / appScale;
appLeftOffset = Math.round((appSize.width - guiSize.width) / 2);
 } // if device is taller than GUI's aspect ratio, width determines scale 
else { appScale = deviceSize.width / guiSize.width;
 appSize.height = deviceSize.height / appScale; appLeftOffset = 0;
 }

http://www.Adobe.com/devnet/air/articles/multiple-screen-sizes.html

Ask yourself what I apply this code?

It doesn't seem to work with the scene...

Did you write that correctly? Your app is the landscape, and you gave the portrait for the device numbers. Did you mean 960 x 540?

That said, you can delete all of your code and let Flash scale for you. Make sure there is an important in the Middle content and additional content on the edges in your game scene. There are three variants of working this way:

1.

1.1 prepare your ground at 800 x 600, the aspect ratio of the iPad and have additional content on the left and right of the stage, go far enough out to make the content be 1066 pixels wide.

1.2 do not use any code to set the scale of the scene, the default value of "show all" is what you want.

1.3 when you play the game on an iPad, it will show in the middle of 4:3 of the game. On an iPhone, it will show a little more, and on the broader Android, it will show even more. This extra content can be say more background, or more than a field of stars.

2.

2.1 define your step to 960 x 540, which is be the biggest ratio Android. Have additional content above and below the turntable, so that it reaches a height of 720.

2.2 do not use any code to set the scale of the scene, the default value of "show all" is what you want.

2.3 when you play Android game will be able to see exactly what was in the stage space, and the iPhone will see a little more of what was greater than one under the stage. The iPad you will see everything above and below the plate.

3.

3.1 prepare your ground to 840 x 540, where the Middle 720 x 472 is the important part of the scene and almost four sides of the stage is contained in the bosom of the scene, but not fundamental. Just like when dealing with security action on television.

3.2 set the scene balance mode on 'borderless ':

import flash.display.StageScaleMode;

stage.scaleMode = StageScaleMode.NO_BORDER;

3.3 now when you play the game, you will see all the height of the stage on the iPad, but will miss a little left and right, and you will see all the width of the stage on the broader Android, but will miss a little top and bottom.

The good thing about the above approaches, is that it will work for each size of unit there, not only the one you mentioned, and all without any code.

Tags: Adobe AIR

Similar Questions

  • Smartphones blackBerry how to move an application icon to the home screen

    How to move an application icon in the menu of the applications to the home screen.

    For example the browser icon?

    domdp wrote:

    ... I have the selected theme and I get 10 icons along the left side and bottom...

    ... I think I may be limited to 10 icons...

    Witch hunt... But in reality its limited to 9 icons in the theme of the profiles icon is still present. From this screen, press Menu to display the largest list of icons. ARange so the first 9 icons are the ones you want to see on the theme of the.

  • How can I force a reset of the device?

    My code crushes several modules and also makes changes to the Group module that contains these modules.  I then calls CodeModuleManager.promptForResetIfRequired (), but the BB do not think that a reset is required.  (I also called CodeModuleManager.IsResetRequired (), and he returned false.

    However the new modules I've written are not taking effect until after the BB is reset (I've tested by removing the battery).

    How can I force a reset of the device from my Java code?

    Thank you

    Paul

    Take a look at this thread. You might get an idea.

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&message.ID=13762#M13762

    Concerning

    Bika

  • I received an error message on my iPad: the application has lost the device context when I try to open the Jam Cookie

    If someone got the error message: "the application has lost the device context? This appeared on my iPad on the application of jam cookie there is a thin red strip across a black screen with the error message locked in the red band. Help!

    Reset the iPad.  Press and hold the power and home together for 10 seconds until the Apple logo appears.

  • in the photo library I'm wrong dates 2026 through 2030 how to change this big mistake of the apple of the foto system?

    How can I change an error in the photos of apple library where records are date in 2026 to 2030 groeps?

    Select the photos and use the Image menu ==> adjust the date and time command

    LN

  • How to change language of Elizabeth to the English in InDesign

    How to change language from Danish into English in InDesign?

    Hi Kiholm,

    Welcome to the community!

    We cannot change the language once the software is installed, you can certainly change the language of the creative cloud desktop application. So, for now uninstall the product in Danish Exchange English language then reinstall from the app.

    Thank you!

    Ankit

  • How to change your iCloud ID if the current is not accessible?

    I'm trying to help my father with the following problem. He managed to set up a user ID iCloud with an e-mail address that does not exist. (Bad typing!) Apple wants to check it out, but there is no way to do it. How can I change this wrong ID for the right one? I don't want to lose any of its data. I'm kinda a beginner when it comes to Apple and iCloud.

    Go to iforgot.apple.com

  • How to change a file name in the Photos? (no title)

    I know how to change the title of a photo in the Photos.  But I do not see how you change a file name.  Can anyone help?

    Photos will not change an imported file.  The original master image file is preserved. You can't even change the file name.

    To change the name of the file, export the Photos photo: file > export, and then specify a different file name in the export Panel.

    Re-import the renamed picture, then delete the first version you imported.

  • How to keep an application running on the windows xp task bar permanently?

    can someone tell me please how to keep an application running continuously in the windows xp taskbar? I think that this is really annoying when I have to click on it to launch it. the application that I want to run permanently is U torrent.

    remain permanently on the taskbar, a program to start when windows starts, refer to options in your program to see if you can start with windows, or if a function has been added to services in administrative tools, start, auto value.

    --------------------

    below to add programs to the quick launch:

    http://www.Dummies.com/how-to/content/how-to-add-applications-to-the-Quick-Launch-bar-I0.html

    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/win_tray_add_program_quick_launch.mspx?mfr=true

  • How doI change my E drive to the D drive designation without moving cables

    I am setting up a Linksys network drive. Is it forces me to insert a blank diskinto my E drive. I have only a drive and D on this computer. How can I change my D drive to a designation of drive E without moving cables

    Hello

    I think that might help you, how to change the drive letter in Windows XP:

    http://support.Microsoft.com/kb/307844/en

    Part:

    How to change a drive letter

    LC

  • How to change photo avatar lil at the top right of the hotmail profile?

    Hey there's good people!

    For some reason when I change my display picture in my profile for a change but the avatar of lil top-right corner is always the same it never becomes one that is in my profile. Please can someone give me a tip for my avatar on the upper right is the same as that of my profile. I know that you have to go click next to your avatar to change the photo and it would auto, it allows to work for me, now it doesn't. Please how can I change my avatar lil on the upper right photo, so it's the same as my profile picture.

    Thanks guys :)! Ill wait!

    Maybe you want to ask your question at the forum of Windows Live Hotmail. After all, it's Vista Forum.
    Here is the link:
    http://www.windowslivehelp.com/solutions.aspx?ProductID=1

    t-4-2

  • How update you an application installed with the Blackberry Storm update .cod files?

    Hello

    I was sent to some application software for my Blackberry Storm 9500. I managed to install the basic software using the BB Desktop Manager normal software, however, there are four files as sitting there, that look they are there to install, update the software - records are different on different BlackBerry names "4.2.1", "4.3", "4.5" and "4.6" - my knowledge limited, I think that this refers to operating systems...

    I guess I would need to install the file 4.6 .cod file, however, I just can't handle it all. The Director of the office, I can only try to update o/s handset, but I can't actually update individual applications that I see!

    Can someone tell how to do this, because he's completely beat me? Be nice... I'm new!

    the alx file is only a link to the file of the Cod. DM load the alx file, search for information on the cod and load the cod on the device.
    In cod, it has compiled software.

    Installation of OTA is similar. The jad file contains settings and links to the cod file.

    The javaloader.exe (comes with the JDE) you can install cod files directly.

    There is also an activeX plugin (which uses javaloader) to load the cod files on a device.

  • How to change display name content in the assignments Panel?

    It sounds like such a simple question, but I've been googling and searching forums 30 minutes now with no luck.  So I was wondering if it is even possible at all.

    How can we change the name of the content in the assignments Panel?  The names given here seem random and our publishers are complaining.  I saw in other proper names beautiful screenshots and tutorials for the stories, but I was not able to understand.  How to change the name of what I've highlighted in the screenshot below?

    Thank you and sorry for what seems like such a basic question but my creators don't know and me (technical support) are waiting to understand for them.

    3-18-2014 9-14-30 AM.png

    Kind regards

    -Aaron

    First check the content. Then simply click on the name of the story.

    Keep in mind that you only change the name in the Panel, not the name of the actual file BCTI.

  • How to change data objects and update the corresponding task and task forms?

    Hi all

    I modified this thread because I found that I had many questions to ask.

    1.
    I'm quite new to OBPM and would like to know how to change data - for clarity objects add a new attribute "Dependents of the Client" "Customer care" - and therefore update the task that uses the 'customer information' what makes via data binding - I get an error message here - or via the data about the data Task-The chosen tab it does not appear to be linked to my approach in some sort.

    2.
    Will be the task form that I generated earlier in < 1 > update automatically? Is it possible to update manually if the task has been clearly customized?

    3.
    What are the objects of project data? They do not store values in my process. They are for the arguments only - like reusable process?

    Thanks in advance,

    Kind regards

    Yanis

    Hi Yanius,

    (1) assume that you start from scratch. First, you declare your data object structure. To do this, you must go to the BPM project Naviagtor, right-click on 'Catalogue of trades' and create a new Module. Then you can right click on the module you created and select the new object of trade. Add all the attributes you need. It is the same to declare a class in Java. Second, you must declare a variable of the type process you have created: select the process, go to the Structure display (if you don't go and activate it in menu view Jdev-> Structure). Right click on the Process data object and create your variable. It's like setting a variable in Java. In short, answering your question, make the path opposite: find in your process of type "Customer Details", then go to your catalog Business, right click and change the definition to add what you need.

    (2) the human task will not update automatically (annoying). If you change the object itself, so you don't need to change your mappings because actually there the same object you are through the task as in / out argument. There are two things here: the human task and form associated with it (where probably change you the subject i.e. customer details). Go to the form (.jspx) - click on the tab links (by default, you are in the Design). In the links page, there is a link on top: "Page Définition File" (something like proj/pageDef/...xml). Open the XML file and go to the source. There you can add manually now all the attributes you need and that were not available before (i.e. dependent Client). It's a little complicated, but at least you don't have to recreate it. particularly useful if you have already implemented and subsequently form, you need to add more things (business is very good to say otherwise, "I would like to see something else in the form" ;)

    (3) project data objects are visible by all processes that you have in the project rather than the object of process data that are visible only to the method where you set the variable to. This means that you declare an object of data of the project once and then it will be available to all processes. Keep in mind that each process has a copy of it. In other words, it is not like a global variable that everyone sees. If edit you in a single process, other processes will not see the new value.

    I hope that I have answered your questions.
    See you soon,.
    Felipe

  • How to change from "let indesign determine the color.

    How do I cange "let indesign determine the color" "let printer determine colors? in the print window, I can choose only "let indesign determine color."

    Thanks for help

    Angelika braun

    You're probably on a no-post script printer printing if InDesign does not give you this option.

    If you select the 'Document' radio and printer profile, select the document profile, InDesign does not perform color conversion.

    Normally, however, it is preferable to use the Adobe color management. This means, by printer profile, select the profile for the type of printer and paper. This should give a more accurate impression.

    If you're still having problems, you can try to export a PDF file, then print to Acrobat.

Maybe you are looking for