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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:36:22+00:00 2026-05-25T03:36:22+00:00

This has been driving me nuts. I’ve worked with SWFObject in the past which

  • 0

This has been driving me nuts. I’ve worked with SWFObject in the past which is great. However I have a requirement not to use JavaScript. So when I try to do flashvars examples all over the net, they don’t seem to work for me.

Steps to repeat:

1) Create a pure AS3 project using Flex or Flash Builder

2) In the index.html wherever there is a .swf, add a name value pair suffix.
test.swf?foo=bar

3) In the constructor of the main class Sprite, trace(root.loaderInfo.parameters.foo).

Expected: bar but traces out as undefined

I’ve tried setTimeout() to evaluate 5 seconds in the future, still doesn’t work as if it’s not loaded at all.

        <noscript>
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="${width}" height="${height}" id="${application}">
            <param name="movie" value="${swf}.swf?foo=bar" />
            <param name="quality" value="high" />
            <param name="bgcolor" value="${bgcolor}" />
            <param name="allowScriptAccess" value="sameDomain" />
            <param name="allowFullScreen" value="true" />
            <!--[if !IE]>-->
            <object type="application/x-shockwave-flash" data="${swf}.swf?foo=bar" width="${width}" height="${height}">
                <param name="quality" value="high" />
                <param name="bgcolor" value="${bgcolor}" />
                <param name="allowScriptAccess" value="sameDomain" />
                <param name="allowFullScreen" value="true" />
            <!--<![endif]-->
            <!--[if gte IE 6]>-->
                <p> 
                    Either scripts and active content are not permitted to run or Adobe Flash Player version
                    ${version_major}.${version_minor}.${version_revision} or greater is not installed.
                </p>
            <!--<![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>
    </noscript>   

AS3

package
{
import flash.display.LoaderInfo;
import flash.display.Sprite;

public class FlashVarsTest extends Sprite
{
    public function FlashVarsTest()
    {
        var paramsObj:Object =
            LoaderInfo(root.loaderInfo).parameters;
        trace("foo="+paramsObj["foo"]);
    }
}

}

This doesn’t work either:

package
{
import flash.display.LoaderInfo;
import flash.display.Sprite;
import flash.events.Event;

public class FlashVarsTest extends Sprite
{
    public function FlashVarsTest()
    {

        this.addEventListener(Event.ADDED_TO_STAGE, init)
    }

    private function init(event:Event):void
    {
        var paramsObj:Object =
            LoaderInfo(root.loaderInfo).parameters;
        trace("foo="+paramsObj["foo"]);

    }
}

}

  • 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-25T03:36:22+00:00Added an answer on May 25, 2026 at 3:36 am

    Update after seeing OP code:

    Your error is in the non-IE object tag:

     <object type="application/x-shockwave-flash" data="${swf}.swf?=foobar"
    

    Gotta love a typo!


    Have you tried using the FlashVars object param tag instead of passing them as part of the URL?

    <object classid="blah blah">
        <param name="movie" value="test.swf" />
        <param name="FlashVars" value="foo=bar" />
        <embed src="test.swf" FlashVars="foo=bar" />
    </object>
    

    Obviously I’ve omitted a lot of extra stuff here, but this should illustrate how variable passing is done.

    As a side note though, passing variables though the URL should work in AS3, as this blog by Peter deHann illustrates: http://blogs.adobe.com/pdehaan/2006/07/using_flashvars_with_actionscr.html

    Testing myself:

    I used ExternalInterface to output to the Firebug console. Both outputs come out as expected, proving that there is not drawing delay associated with root.loaderInfo

    package
    {
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.external.ExternalInterface;
    
        public class Main extends Sprite
        {
            public function Main()
            {
                if(ExternalInterface.available) ExternalInterface.call("console.log",root.loaderInfo.parameters.foo);
                (stage) ? init() : addEventListener(Event.ADDED_TO_STAGE,init);
            }
    
            private function init(evt:Event = null):void
            {
                if(evt) removeEventListener(Event.ADDED_TO_STAGE,init);
                if(ExternalInterface.available) ExternalInterface.call("console.log",root.loaderInfo.parameters.foo);
            }
        }
    }
    

    HTML:

    <!DOCTYPE html>
    <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=utf-8" />
    
            <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>          
    
        </head>
        <body>
                <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%" id="Main">
                    <param name="movie" value="Main.swf?foo=bar" />
                    <param name="quality" value="high" />
                    <param name="bgcolor" value="#ffffff" />
                    <param name="allowScriptAccess" value="sameDomain" />
                    <param name="allowFullScreen" value="true" />
                    <!--[if !IE]>-->
                    <object type="application/x-shockwave-flash" data="Main.swf?foo=bar" width="100%" height="100%">
                        <param name="quality" value="high" />
                        <param name="bgcolor" value="#ffffff" />
                        <param name="allowScriptAccess" value="sameDomain" />
                        <param name="allowFullScreen" value="true" />
                    <!--<![endif]-->
                    <!--[if gte IE 6]>-->
                        <p> 
                            Either scripts and active content are not permitted to run or Adobe Flash Player version
                            10.2.0 or greater is not installed.
                        </p>
                    <!--<![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>    
       </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This has been driving me nuts for the past hour. I have two computers,
This has been driving me nuts. I hope it's not been asked before but
This has been driving me crazy for the past few minutes I have a
This has been driving me nuts for a week now. I have a class
This has been driving me nuts all day. I have a weird bug that
This has been driving me absolutely nuts. I have a substitute function like this:
This error has been driving me nuts. We have a server running Apache and
So this has just been driving me nuts! I have looked through tons of
I have a javascript function that has been driving me nuts. This is the
This has been driving me nuts. I keep getting the following exception System.InvalidOperationException: The

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.