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 6343225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:23:48+00:00 2026-05-24T20:23:48+00:00

I am using Flash Builder 4.5 to build an iPhone app. In order to

  • 0

I am using Flash Builder 4.5 to build an iPhone app.

In order to display ads I plan to use StageWebView and load a webpage containing the ad code.

Lets say the ad will be 320×50 pixels. So the Actionscript code would look similar to this:

adView = new StageWebView();
adView.loadURL("http://www.myadishere.com/ad.html");
var top:Number = navigator.actionBar.measuredHeight + 1
adView.viewPort = new Rectangle(0, top, 320, 50);
adView.stage = stage;

In the application I have set the applicationDPI=”160″ so the application is displayed properly when run on iPhone3 and iPhone4.
However the content of the StageWebView looks tiny on iPhone4.
If I do adView.drawViewPortToBitmapData() the bitmap’s size is OK.

So the question is how to make the StageWebView content to scale accordingly, so it looks OK regardless of the screen DPI?

  • 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-05-24T20:23:50+00:00Added an answer on May 24, 2026 at 8:23 pm
     You need to scale by yourself. Here is sample code.
    
    
    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" 
             xmlns:s="library://ns.adobe.com/flex/spark" width="100%" height="100%" top="0">
        <fx:Declarations>
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
                import mx.core.FlexGlobals;
                import mx.core.IVisualElement;
                import mx.events.FlexEvent;
    
                import spark.components.View;
                import spark.events.ViewNavigatorEvent;
    
                [Bindable]
                public var htmlText:String;
                public var url:String;
                private var swv:StageWebView;
                private function resizeSWV():void{
                    var currentFlexScalingFactor:Number=FlexGlobals.topLevelApplication.runtimeDPI/FlexGlobals.topLevelApplication.applicationDPI;
                    if(swv!=null){
    
        //swv.viewPort=new Rectangle(0, stage.stageHeight-height*currentFlexScalingFactor-FlexGlobals.topLevelApplication.tabbedNavigator.tabBar.height*currentFlexScalingFactor,width*currentFlexScalingFactor,height*currentFlexScalingFactor);
    
        swv.viewPort=new Rectangle(0, systemManager.screen.height*currentFlexScalingFactor-height*currentFlexScalingFactor-FlexGlobals.topLevelApplication.tabbedNavigator.tabBar.height*currentFlexScalingFactor,width*currentFlexScalingFactor,height*currentFlexScalingFactor);
    
                    }
                }
    
            ]]>
        </fx:Script>
        <s:creationComplete>
            <![CDATA[
            swv=new StageWebView();
            resizeSWV();
            swv.stage=stage;
    
    
            var htmlString:String=htmlText;
            var urlL:String=url;
    
            swv.loadURL(url);
            (owner as View).addEventListener(ViewNavigatorEvent.REMOVING,
            function(event:ViewNavigatorEvent):void{
                swv.viewPort=null;
                swv.dispose();
                swv=null;
            }
            );
            ]]>
        </s:creationComplete>
        <s:resize>
            resizeSWV();
        </s:resize>
    </s:Group>
    
     This is for TabbedViewNavigatorApplication.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Flash Builder 3 to edit my Flex app, but I noticed that
I am trying to build my iphone app from a swf in windows using
I have been using Flash Builder to build my flex software and I am
I'm using Flash Builder 4.5. In an .mxml file, if you want to use
I am using flash builder to make an app for android/ios. How would you
I am using Flash builder 4 to both build and manage (via cvs) projects.
I am using Flash Builder Buritto with the latest nightly Flex 4.5 SDK, build
I'm using Flex 4.5.1 with AIR 2.7 (and Flash Builder 4.5.1) to build an
I am creating an iOS app using Flex 4.5 (Flash Builder 5.5) and I
I'm building a mobile AIR app using Flash Builder 4.5. The initial view in

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.