tags:

views:

28

answers:

2

Hello

I have this project where I need to load 3 external variables into my swf-file on a webpage. The wierd thing is that I got this to work before, but now it suddenly wouldn't :\

I use swfObject to setup the variables like this:

<script type="text/javascript">
    var flashvars = {page:"page1", box:"head2"};
    var params = {};
    params.menu = "false";
    params.quality = "best";
    var attributes = {};
    swfobject.embedSWF("handbook_v2.swf", "header", "700", "374", "10.0.0", false, flashvars, params, attributes);
    </script>

And I use these lines in my AS-file to load the variables into the swf:

public var page:String = String(root.loaderInfo.parameters.page);
public var box:String = String(root.loaderInfo.parameters.box);

To test if the stings got loaded correctly i setup a dynamic textbox to show me the content of a variable inside the swf, when loaded outside the flash-environment:

variableBox.text = box; 

This shows the variable as undefined

What am I doing wrong?

+1  A: 

If you're using Flash CS5 , have a look at this
http://forums.adobe.com/thread/644057

PatrickS
That could be the problem... Thanks for making me aware of this issue!
VoodooBurger
A: 

What happens when you try to pass the variables to flash in the html?

<param name="flashvars" value="var1=x&var2=y&...">

This will help narrow down the problem.

mdonovan2010