Proper way to scale assets for multiple devices

I am working on an ActionScript Mobile app which I intend to build for iphone 3gs, iPhone 4 and iPad 1&2.
What is the correct way to scale assets such as background images so that I may be able to use the same graphical assets for all of the mobile devices above?
Using AIR 2.7 and in my app descriptor file I have specified "cpu" for renderMode and "true" for fullScreen. From what I have read, the fullscreen bug in AIR 2.7 is only present when using gpu as the rendermode w/ fullscreen, so I don't think that is what is going on.
I have a background image which is supposed to fill up the entire screen for all devices. This image is in a swc file and has these dimensions: 960 x 640
In my main class I have included the following:
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
When I test on iPhone 4, it looks fine and fills up the entire screen as expected. When I test on iPad 1, the image is not wide enough and is a bit too short. Shouldn't the following code force the background image to fill the entire screen regardless of device?
backgroundImage.width = stage.stageWidth;
backgroundImage.height = stage.stageHeight;
Instead, it makes the backgound really small in the upper left hand corner for all devices. Can someone shed some light here?  I am stumped.
Hopefully I am doing someone stupid and it is an easy fix..Thanks!

Here is what I have been doing. Do what you did by scaling the stage to the top left and fill the entire screen.
Now set up an onEnterFrame event to give your background image dimensions. Since you want one image to work for all the devices it has to be an image that works even if part of it is not showing so design with that in mind.
So lets say your image is iPad screen size 768 wide x 1024 tall. I pad is a 3/4 screen ration so 3 wide by 4 tall in proportion.
Set up a variable that measures the screen ratio, so something like
var frameRatio = stage.stageWidth / stage.stageHeight;
this will return a result of 0.75 or 3/4
Now since you know this you can set up an if else statemenet (excuse my sloppy code, do not copy paste)
if (frameRatio >= 0.75)
backgroundImage.height = stage.stageHeight;
backgroundImage.scaleX = backgroundImage.scaleY <------ this will scale the image proportionally to match the height.
else if (frameRatio < 0.75)
backgroundImage.wdith = stage.stageWidth; <------ notice if its less than .75 we now make the image first fill the stage to the stage's width
backgroundImage.scaleY = backgroundImage.scaleX  <---- notice these are flipped so now we proportionally scale the height based on the width
This works well for me even with orientation changes. Its easiest to set you background image point of refrence to the center and then orient it by simply dividing the stageWidth and stageHeight by 2 for the x and the y values respectively.
Let me know if that helped at all I can post an actual line of code if need be.

Similar Messages

  • I have one apple ID for multiple devices in my family.  I'd like to keep it that way for itunes/app purchases.  I would like a simple step 1, step 2, step 3 response on what I need to do to separate all other features like imessage, contacts, emails, etc.

    I have one apple ID for multiple devices in my family.  I'd like to keep it that way for itunes/app purchases.  I would like a simple step 1, step 2, step 3 response on what I need to do to separate all other features like imessage, contacts, emails, etc.
    I have been reasearching how to do this on the internet, but I haven't found an easy explanation yet.  My family is going crazy over each others imessages being sent to others in the family and not being able to use FaceTime because of conflicting email addresses.  I have read that if each person gets their own iCloud account, this would work.  However, I need to know what to do after I set everyone up with their own iCloud account.  Do I make that the default email address to be contacted or can they still use their hotmail email addresses.  Any help- with easy explanation- would be much appreciated!!

    We do this in my family now.  We have one account for purchases, so it is used to share music and apps (I think that is in Settings/iTunes & App Stores).  Each iDevice has this configured.
    Then, each of us has our own iCloud account that is configured under Settings/iCloud.  That then allows us to have our own Mail/Contacts/Calendars/Reminders/Safari Bookmarks/Notes/Passbook/Photo Stream/Documents & Data/Find My iPhone/and Backup.  That Backup piece is pretty sweet and comes in handly if you replace your iDevice.  You can just restore from it.
    So we all share the Apple Store account but we all have our own iCloud accounts to keep the rest seperate or things like you mentioned are a nightmare.
    In answer to what iCloud does for you: http://www.apple.com/icloud/features/
    Think of it as an internet based ("cloud") area for all of those items listed in my response.  What you need to remember is photo stream only maintans the last 1000 pictures so don't count it as a complete backup solution for your pictures.  Even though I rarely sync with a computer these days, I do still try to sync my phone with iPhoto (I have an iMac) so that I have copies of all of my pictures.  1000 may not stretch as far as it sounds.
    Message was edited by: Michael Pardee

  • Can I use the same Apple ID for multiple devices

    Can I use the same Apple ID for multiple devices?

    Yes. Up to five devices can be authorized on a single computer using the same Apple ID. You can also use the same Apple ID on multiple devices is they are all going to use the same iTunes Library by the same user. But it's ill-advised if multiple users are involved who wish to keep their devices separate from the devices belonging to other users.
    How to use multiple iPhone, iPad, or iPod devices with one computer
    Using More than One iDevice on the Same Computer
    This applies mainly to couples who are adding another device and do not want their email, messages, etc. being duplicated on both devices. To begin read: How to use multiple iPhone, iPad, or iPod devices with one computer. You need to establish a separate Apple ID and password for whomever will use the new iDevice. See Apple - My Apple ID and Frequently asked questions about Apple ID. The easiest way is to do this on the computer using iTunes: iTunes- How to set up an Apple ID within iTunes.
    On the computer create a new user account for the person with the new iDevice. This will be the user account that person will always use. He/She will no longer use the other user account. This way that person will have a separate iTunes Library
    Start by transferring the new device(s) to a new account along with all your data.  Save any photo stream photos that you want to keep to your camera roll (unless they are already in the camera roll) by opening your Photos app, tap on Albums icon at the bottom. Now, tap on My Photo Stream album; tap Select; tap on the photos you want to select;, tap the share icon (box with upward facing arrow) in the lower left corner; then tap Save to Camera Roll.
    If you are syncing notes with iCloud that you want to keep then you need to open each of your notes and email them to yourself. Later you can copy and paste the text into new notes created in your new account.
    Tap on Settings > iCloud > Delete Account (only deletes it from this device, not from iCloud; the person keeping the current account will not be affected,) provide the password to turn off Find My Phone and choose Keep on My iDevice when prompted.  Sign in with a different Apple ID to create your new account. Choose Merge to upload your data.
    Once you are on separate accounts, you can each go to icloud.com and delete the other person's data from your account.
    Note: The essence of the above was created by user, randers4. I
    have made substantial changes to improve readability and syntax.

  • Same apple id for multiple devices

    I have been use the same apple id for multiple devices (both are iPhones running iOS 6 - one is a 4, the other a 4S.) I'd like to sync separate content for each device using the same instance of iTunes (iTunes V 10.7 installed on MacBook running OS X 10.6.8.) Can I assign the second device a separate apple id in odrer to differentiate the content? Thanks for your assistance!

    No, a second Apple ID will not work. iTunes can already tell them apart.
    When you connect the first iPhone to iTunes, check and uncheck the things you want and Sync.
    Do the same with the second iPhone.

  • Time Capsule only works for one device at a time, how to make it capable to be used for multiple devices at times

    Time Capsule only works for one device at a time, how to make it capable to be used for multiple devices at times.
    Please help to set it up, thanks in advance

    You need to give more info..
    Firstly only works for what.. networking.. backup.. wireless. You need more nouns.. more adjectives... describe what you want and what fails.. then we can figure out why.
    Most likely you have bridged it when it should be in router mode..
    Most likely you are using Lion or ML which has the airport utility bridge the TC by default.
    Change it to working as a router. That might help.
    If you press reset button it will default back to router btw.
    If you are on Lion.. use a real utility. http://support.apple.com/kb/DL1547

  • What is proper way to report suggestions for app features And bugs to Apple

    What is the proper way to report suggestions for app features to Apple? Or, do they even want suggestions?
    And, how about reporting app bugs? Should I just assume the bug is already known, or is there a way for (quickly) reporting them?

    I'm not sure about bugs in non-Apple apps, but bugs in Apple apps can be reported via this form:
    http://www.apple.com/feedback/ipad.html

  • Is it a proper way to use queue for consumer/producer model?

    Hi all,
      I am following the example of consumer/producer model to use the queue to synchronize the following process: The producer is a loop to produce N numbers, I will put every generated number into an array and after every 5 numbers generated, I put the array into the queue and pass it to the consumer. I have to wait the consumer use up the data and it will then remove the element from queue so the producer will get a chance to produce another 5 numbers. Since I set the maximum size of the queue to be ONE, I expect the producer and consumer take turns to produce / consume all five numbers and pass the chance to the other. Here is my code
    when the case box is false, the code will be
    For the first 5 numbers, the produce will generate every thing right and put that into the array, and it will pass the array to the quere so the consumer will get a chance to loop over the array. I except the procude's loop will continue only when the queue is available (i.e. all elements are removed), but it seems that once the consumer start the loop the produce 's loop will continue (so the indicator x+1 and x+2 will show numbers changed). But it is not what I want, I know there must be something wrong but I can't tell what is it.
    Solved!
    Go to Solution.

    dragondriver wrote:
    As you said in 1, the sequency structure enforcing the execution order, that's why I put it there, in this example, to put the issue simple, I replace the complete code with number increase, in the real case, the first +1 and +2 must be executed in that order.
    Mikeporter mentioned:
    1. Get rid of all the sequence structures. None of them are doing anything but enforcing an execution order that would be the same without them.
    So even if you remove the sequence structure, there will be a fixed & defined execution order and that is because LabVIEW follows DATA FLOW MODEL.
    Data Flow Model (specifically in context of LabVIEW): A block diagram node executes when it receives all required inputs. When a node executes, it produces output data and passes the data to the next node in the dataflow path. The movement of data through the nodes determines the execution order of the VIs and functions on the block diagram (Click here for reference).
    Now in your code, just removing the sequence structure will not make sure that the execution order will gonna remain same but you need to do few very small modifications (like pass the error wire through For loop, before it goes to 'Dequeue Element' node).
    Coming to the main topic: is it a proper way to use queue for consumer/producer model?
    The model you're using (and calling it as consumer/producer model) is way too deviated from the original consumer/producer model model.
    dragondriver wrote:
    For the second one, yes, it is my fault to remove that while. I actually start from the example of Producer/Consumer design pattern template, but I didn't pay attention to the while loop in the consumer part.
    While loops (both Producer & Consumer) are the essential part of this architecture and can't be removed. You may want to start your code again using standard template.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • Responsive projects autosizing for multiple devices -- best practices?

    While it's a nice idea to have the three different breakpoints on width that allow you to make some major layout changes, I'm having trouble making this work well across multiple devices.  With the high resolutions of current mobile devices, this model just doesn't seem to work well.  For example, the iPad 2 in landscape mode select the desktop layout, which isn't bad, but in portrait mode gets the tablet layout, which by default is set up to be landscape.  I changed the heights for both breakpoints to better fit the iPad, but then the iPhone in landscape gets the tablet layout, requiring a lot of scrolling.
    Given the wide range of resolutions on mobile devices, it's not at all clear how this a simplistic mechanism like this could ever work.  For one thing, it sure seems like you need to provide for both portrait and landscape layouts on tablets and phones, with Captivate using both width and height to select the best one.  Also, is there any way to tell it to fill the screen without scrolling? How about automatically leaving the area clear where there's a status bar (or telling it to hide the status bar)?
    I could just create a separate version of the project for each device, but then lose much of the value of creating a Responsive Project in the first place.  Have those of you with more experience found good ways to deal with these variables, or is the best option to just create separate versions of the project?

    While it's a nice idea to have the three different breakpoints on width that allow you to make some major layout changes, I'm having trouble making this work well across multiple devices.  With the high resolutions of current mobile devices, this model just doesn't seem to work well.  For example, the iPad 2 in landscape mode select the desktop layout, which isn't bad, but in portrait mode gets the tablet layout, which by default is set up to be landscape.  I changed the heights for both breakpoints to better fit the iPad, but then the iPhone in landscape gets the tablet layout, requiring a lot of scrolling.
    Given the wide range of resolutions on mobile devices, it's not at all clear how this a simplistic mechanism like this could ever work.  For one thing, it sure seems like you need to provide for both portrait and landscape layouts on tablets and phones, with Captivate using both width and height to select the best one.  Also, is there any way to tell it to fill the screen without scrolling? How about automatically leaving the area clear where there's a status bar (or telling it to hide the status bar)?
    I could just create a separate version of the project for each device, but then lose much of the value of creating a Responsive Project in the first place.  Have those of you with more experience found good ways to deal with these variables, or is the best option to just create separate versions of the project?

  • Organizing Media for multiple device usage?

    Many apologies if this is a common question (having looked here I couldn't tell if it was addressed to my specs) but I have a generalized question in reference to organizing ALL of my media (music, photos, movies/videos, files) that can be accessed and shared between the multiple devices we have in our family (Iphone4, Iphone 3GS, AppleTV, Ipad2 coming…). I feel like we have all these many files spread out over a bunch of different hard drives and devices and want to find a way, be it an App that does it or a book/how to guide I can use to compile all of my files into one source to be used and freely shared by all devices. Any help would be GREATLY appreciated, thanks!
    Joe

    Hey Randman 20,
    Thanks for the reply! Yeah, consolidating files is one thing, but more importantly, how I can access and share the music, photos and video I have on say one drive with my laptop but more importantly with my iPhones and iPad2. I have an iPhone, my wife as well and I have an iPad2 for work, and to be able to sync all these devices and manually move files from one to another without having to deal with access problems or non-allowance to put everything on any of our approved devices effortlessly.
    I dont mind taking a weekend to organize (any tips or points to software assistance would always be appreciated) its more just finding a way to have one place be the source for all of my media.
    Thanks!
    Joe

  • Managing installed apps for multiple devices

    Is there a way to create an "app playlist" in order to easily create a common set of installed apps across multiple devices?  I'm tired of having to install the same app on each of my kids devices.  Also, I don't want to enable auto install new apps because I don't necessarily want my kids to get apps that I'm installing on my devices.
    Thanks

    The un-compatible updates will not install on the iPod.
    Make sure that you retain a copy of the version that is compatible with iOS 4.2.1 since you can only redownload the latest version version from the App store.
    I would backuyp the library to an external HD by:
    iTunes: Back up your iTunes library by copying to an external hard drive
    Note that when you update an app on the iPod and then sync, the update apps is also synced to the iTunes library.

  • Can you have one icloud storage plan for multiple devices

    hi,
    i'm wondering if there is a way of consolidation various icloud storage plans into one.
    i only use my free 5gb for my 5s as i back up photos to my mac, however my wife has already upgraded her storage plan for her 5c to the £1/month.
    with the new release of backing up your entire photo library on you mac (which im keen to do) im going to need to upgrade my own account as the mac is set up for my apple id.
    i currently also pay for itunes match.
    im keen to know if there is a way we can use one large back up facility for: my 5s, the mrs's 5c, the mac, with out paying for multiple storage plans.
    im guessing the itunes match is stand alone but if i can have one payment for large storage and put everything there that would be ideal, and seem a reasonable request for most families.
    any help greatly appreciated
    thanks
    Scott

    Accounts can't be merged.

  • Fixed Layout EPUB - for multiple devices

    We are looking to create an EMAGAZINE or EPUB with a fixed layout for employee benefit guides that will be viewed on multiple devices (desktops, laptops, tablets, and mobile - both PC and MAC devices) and I am wondering what is the best style to use to accomplish this? With the new fixed layout EPUB, it creatively meets our needs, but will it work on a PC? Or tablet that is not Apple?
    What are the best options for a picture heavy/table heavy online "book" created in InDesign?
    Thanks,
    Jamie

    Hi Jamie,
    Yes you can view your fixed layout epubs on a PC/tablet, there are multiple fixed layout readers available on devices. For PC there is Readium that is a Chrome extension.
    Thanks
    -Anshul

  • Saving separate sets of apps for multiple devices

    Hi,
    This has probably been asked before, sorry if redundant.
    I have an iPhone and an iPad, my wife has an iPhone. We prefer different apps on pur phones and a different set for the iPad. iTunes recognizes the devices with different names when they are attached, but the app set from the last device attached is still checked.
    It's a real pain to have to go through, checking and unchecking each time, just to Sync one or two new items.
    Is there a way to "save" your app set for each item so that when you connect a device, it recognizes it AND the last app set you choose for that device?
    Probably a real easy solution but darned if I can figure it out.
    Thanks
    Joe

    Just tried this with my wifes phone, the last one that was Synced .
    Right click? I am using an Apple mouse, not a two button one.
    I have been told that you can right or left click with an Apple mouse, didn't work here. No pop up menu like with a two button mouse or when using a Windows computer.
    The only Backup option I can see is the choice to Back Up To iCloud or Back Up to This Computer. Is that what you are referring to?
    It's currently backed up to iCloud. Does she need to change that to save her selected set of apps?

  • Lenovo 11s backup one backup for multiple devices

    Hi, have bought 28 devices...
    on first  acitivation, 800MB win 8 update, then 3.62 GB to update to Win 8.1, , then another 1GB for win8.1 updates. 2.5 hours ++
    Microsoft  and Lenovo  seems to have got rid of the concept  of ISO image backup  disks purchase as an option..
    Now if i were to follow the tortuous create system recovery  route   and create  a back up image.
    Could i use that  image  to install  the update/restore on  all the  other devices... or is that "backup" linked to  a windows activation code for the device it was created on?
    Windows 8 and 8.1  a proverbial mess..... 
    Searched online in Lenovo . no answers 
    Welcome  for forum wisdom.
    Mark
    Solved!
    Go to Solution.

    The best way to do what you want to do is to use Microsoft Deployment Toolkit.  There is a learning curve; however, it is the tool Microsoft intends to be used for image capture and deployment in a an environment where you do not already have something like SCCM in place to manage and deploy systems.  With it you can capture an image from a donor machine and you can create deployment media (a usb key) which allows you to deploy that captured image to other machines.  
    Using the method you described, all of the machines would have the same exact SID's (security IDs).  The MDT process uses sysprep so that every machine can be initialized with their own unique SIDs.  

  • Rip/ Encode DVD for multiple devices

    I have multiple iOS devices (iPad; Apple TV 2; iPhone 4; iPhone 3GS) and want to rip/ encode a DVD so I can view it on all my devices. I do not care about HD.
    I know that the 3GS has the lowest video settings. What would be the best settings for these devices? I know H.264 works but it is the other settings I do know about. Does Handbrake's Apple TV 2 setting work for all my devices. However, I would prefer not using Handbrake so what are the max video settings for the following I could use: Resolution? Frame Rate? Bit Rate?
    I understand this question could fit in a number of different topics but I figured I would start here.

    I have the original Apple TV, and based in the default Apple device settings included with HandBrake, I have found using the default original Apple TV settings works well with all my devices - with my original Apple TV (obviously), with my MacBook Pro, with my no longer activated iPhone 3G used as an iPod Touch, and with my iPhone 4.
    Why would you prefer not using Handbrake and what do you plan on using instead?
    As a test, use the default Apple TV 2 settings with Handbrake and see how it turns out for you and if to your liking with your iPad, iPhone 3GS, and iPhone 4 as well.

Maybe you are looking for

  • Error when burning DVD

    I just bought a Mac a few weeks ago, and have had some trouble burning DVD's. I have a G5 running 10.3.9, with a Pioneer Superdrive. I try to burn an image in Disk Utility, but get the error message "The disc is reserved for exclusive use by another

  • Module Null pointer exception

    Hi, I am having a problem with my module written for Enhancing functionality of file adapter.My module validates a input file for a particular record presence and if that record is present it would be processed normally by XI system. But in case, if

  • Uninstalling Camera Raw 8.4 RC CC

       Can soemone please tell me the necessary steps to remove Camera Raw 8.4 RC for Photoshop CC completely so that I can restore Photoshop back to using Camera Raw 8.3. I use MacOSX 10.92 . Thanks Trevor Craig

  • Email message corruption

    I am having problems with a corupted email message (I think). I tried to select an email message in my inbox, and I get a spinning beach ball. It never opens and eventually I have to do a force quit. I am stuck. I can' t use email because each time I

  • Hey All ... Request for some suggestions .....

    Well I would like to know if there is any pre-requisite to learn XMII also is there anyone who is teaching the same in bangalore. Awaiting responses ...... Thanks, Regards, Sunil.