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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:52:23+00:00 2026-06-11T02:52:23+00:00

I have a FlashBuilder project for which I want to set the displayed size

  • 0

I have a FlashBuilder project for which I want to set the displayed size (in browser) only via the html file. I don’t want to hardcode the size of the swf in the flash code.
Also I need to provide several parameters with flash vars.
My html is a modified version of the standard html code generated by FlashBuilder. I try to set the size of the swf in JavaScript and using a container div. So I have the following html code to display the swf:

<html>   
<head>
    <title></title>
    <style type="text/css" media="screen">
        html, body {
            height:100%;
        }
        body {
            margin:0;
            padding:0;
            overflow:auto;
            text-align:center;
            background-color: #ffffff;
        }
        object:focus {
            outline:none;
        }
        #flashContent {
            display:none;
        }
    </style>
    <!-- Enable Browser History by replacing useBrowserHistory tokens
    with two hyphens -->
    <!-- BEGIN Browser History required section -->
    <link rel="stylesheet" type="text/css" href="history/history.css" />
    <script type="text/javascript" src="history/history.js"></script>
    <!-- END Browser History required section -->
    <script type="text/javascript" src="swfobject.js"></script>
    <script type="text/javascript">
        var swfVersionStr = "11.1.0";
        // To use express install, set to playerProductInstall.swf, otherwise the empty string. 
        var xiSwfUrlStr = "playerProductInstall.swf";
        var flashvars = {};
        var params = {};
        var attributes = {};
        flashvars.json = "some json file.json";
        flashvars.width = "900";
        flashvars.height = "480";
        params.quality = "high";
        params.bgcolor = "#ffffff";
        params.allowscriptaccess = "sameDomain";
        params.allowfullscreen = "true";
        params.wmode = "direct";
        attributes.id = "Main";
        attributes.name = "Main";
        attributes.align = "left";
        swfobject.embedSWF("Main.swf", "flashContent", "100%", "100%",
        swfVersionStr, xiSwfUrlStr,
        flashvars, params, attributes);
        // JavaScript enabled so display the flashContent div in case it is not replaced with a swf object.
        swfobject.createCSS("#flashContent", "display:block;text-align:left");
    </script>
</head>

<body>
    <div style="display:block;text-align:left;width:900px; height:480px; position:absolute; top:50px; left:100px">
        <div id="flashContent">
            <p>To view this page ensure that Adobe Flash Player version 11.1.0 or greater
                is installed.</p>
            <script type="text/javascript">
                var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://");
                document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" + pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>");
            </script>
        </div>
    </div>
</body>
</html>

And the following in my flash main method:

public function Main(){

    swfWidth = LoaderInfo(root.loaderInfo).parameters.width;
    swfHeight = LoaderInfo(root.loaderInfo).parameters.height;
    swfFrameRate = LoaderInfo(root.loaderInfo).parameters.framerate;

    json = LoaderInfo(root.loaderInfo).parameters.json;
    loadJsonFile(json); 

    stage.frameRate = swfFrameRate;
    stage.scaleMode = StageScaleMode.NO_SCALE;

    view = new View3D();
    view.width = swfWidth;
    view.height = swfHeight;
    camera = view.camera; 
    cameraController = new HoverController(camera, null, 150, 10, 10);
    this.addChild(view); 
}

However, when I open this in browser the displayed size does not match the size given in the hmtl (with the above code it results in about 700×430 px).

What am I doing wrong?

  • 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-11T02:52:25+00:00Added an answer on June 11, 2026 at 2:52 am

    Finally, I managed to fix it.
    The problem was the Main.html and index.template.html created by Flashbuilder (and wich is not easy to revise, as it is very complex and more detailed than actually needed.

    I created a new .html file with the help of this generator:
    http://www.bobbyvandersluis.com/swfobject/generator/index.html

    .. and now the stage is set as provided by the flashVars.

    This is how my Main looks like now:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <script type="text/javascript" src="swfobject.js"></script>
        <script type="text/javascript">
            swfobject.registerObject("Main", "11.0.0", "expressInstall.swf");
        </script>
    </head>
    <body>
        <div>
            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="850" height="480" id="Main">
                <param name="movie" value="Main.swf" />
                <param name="quality" value="best" />
                <param name="scale" value="noscale" />
                <param name="salign" value="tl" />
                <param name="wmode" value="direct" />
                <param name="bgcolor" value="#cccccc" />
                <param name="allowfullscreen" value="true" />
                <param name="allowscriptaccess" value="always" />
                <param name="allownetworking" value="all" />
                <param name="flashvars" value="json=../somejsonFile.json&amp;width=850&amp;height=480&framerate=60" />
                <!--[if !IE]>-->
                <object type="application/x-shockwave-flash" data="Main.swf" width="850" height="480">
                    <param name="quality" value="best" />
                    <param name="scale" value="noscale" />
                    <param name="salign" value="tl" />
                    <param name="wmode" value="direct" />
                    <param name="bgcolor" value="#cccccc" />
                    <param name="allowfullscreen" value="true" />
                    <param name="allowscriptaccess" value="always" />
                    <param name="allownetworking" value="all" />
                    <param name="flashvars" value="json=../somejsonFilejson&amp;width=850&amp;height=480&framerate=60" />
                <!--<![endif]-->
                    <a href="http://www.adobe.com/go/getflashplayer">
                        <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
                    </a>
                <!--[if !IE]>-->
                </object>
                <!--<![endif]-->
            </object>
        </div>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ActionScript only Flash Builder 4 project of which i know that
I have a flashbuilder project with a big image. The problem is that the
I'm working on a flash project in which I have a swf with a
I am developing a project in Flash Builder which will load a file built
For my Flash Builder 4.6 Project I have a http service defined which looks
I have an AIR project that I was working on Flash Builder 4.5 which
I have a project which has fusion widgets embedded in it. wen i run
have written this little class, which generates a UUID every time an object of
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
Have deployed numerous report parts which reference the same view however one of them

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.