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

  • SEARCH
  • Home
  • 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 7950035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:08:38+00:00 2026-06-04T02:08:38+00:00

I developing an application in Flash Builder with AS3 only (no flex stuff). In

  • 0

I developing an application in Flash Builder with AS3 only (no flex stuff). In flex it is possible to set the application’s dpi by the following code:

<s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
   xmlns:s="library://ns.adobe.com/flex/spark" applicationDPI="320">

But I using only AS3. I have read that it is not possible to change the application’s DPI in run-time (with AS3), but how can I set this in project settings, compiler settings or is there another way to do it?

Also, what is the default application’s DPI setting?

Ask it here because can’t find it on the net (only flex based solutions).

  • 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-04T02:08:40+00:00Added an answer on June 4, 2026 at 2:08 am

    The DPI on mobile is set by the hardware, it is entirely dependent on the phone and screen. When you set the applicationDPI in a Flex mobile you’re telling Flex to automatically scale your assets.

    Automatic scaling. Developers can choose to specify a target DPI for their application by setting the applicationDPI property on the application. When this is explicitly set, developers should set up their skins and layout as if they were running on a device of the given DPI. At runtime, if the device has a different DPI from the specified target DPI, Flex will automatically scale the entire application to preserve the approximate physical size of the application and its controls. For example, if an application is targeted at 160 DPI, it will automatically scale by 1.5x on a 240 DPI device. If you choose not to use this feature, you’ll need to make sure your custom skins and view layouts adapt properly to different pixel densities at runtime.
    Source

    In an AS3 mobile project you’re going to need to handle this yourself.

    You can get the current DPI using Capabilities.screenDPI but I think what you may be after is a ratio to scale your assets by. One way to do this would be to start with the original game width.

     private static const WIDTH:Number = 1024;
    

    You can then get a ratio using

     var ratio:Number = stage.fullScreenWidth / WIDTH;
    

    And apply this to your assets

    myBitmap.scaleX = myBitmap.scaleY = ratio;
    

    Now this isn’t going to take the rotation of the device into account, so fullScreenWidth/Height may be flipped. To check for that you’re going to need to do something like this

    if (stage.fullScreenWidth > stage.fullScreenHeight){
      //portrait 
    } else {
      //landscape
    }
    

    Hopefully this helps

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

Sidebar

Related Questions

I am developing an application in Flex using Adobe Flash Builder 4.5 and I
I'm developing an application using Flas Builder / Flex for Adobe Air. This application
I'm developing application using backbone.js & jquery. I have following code in model: runReport:
I'm developing iPad application in Flash Builder 4.6. My application stop working on device
I am currently developing a mobile application using the latest version of Flash Builder
I am developing a Flex / Flash application which talks to an ASP.Net /
I have a strange issue with Flex 4.6 and Flash Builder 4.6 While developing
I am developing a mobile application in Adobe Flash builder 4.5. I want to
I'm developing a Flash-only application and I want to integrate the flowplayer directly into
I'm developing an AIR application with Flash Builder 4 Beta 2 (nightly SDK) an

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.