send a Param to a SWF

3 posts (showing 1-3)

Market Level 4Community Level 9
1873 posts

I'm trying to send a Param to a SWF that is loaded via Action Script 3.

Below is the HTML code that normally loads the swf.

I need to load it in AS3.

If anyone could solve this that would be a life saver.

<!DOCTYPE html>
<object id="flowplayer" width="300" height="200"
<param name="movie" value="" />
<param name="allowfullscreen" value="true" />
<param name="flashvars"
value='config={"clip":""}' />

posted 2015-04-16T03:41:51-07:00

FGL AdminCommunity Level 4
321 posts

Have you checked out this page?

The example they give looks like this:

// by querying the LoaderInfo object, set the value of paramObj to the
// to the value of the variable named myVariable passed from FlashVArs in the HTML
var paramObj: Object = LoaderInfo(this.root.loaderInfo).parameters.myVariable;
// set the text of the text instance named text1. Use the toString() method
// to convert the value from an object to a string so it can be used in the text field
text1.text = paramObj.toString()[/as3]

Your config variable there is JSON-encoded, so you may need to parse it using JSON.parse before using the variable, or simply provide the variable like so:

<param name=FlashVars value="clip=" />[/as3]

Also, make sure you're using "FlashVars" and not "flashvars"!

posted 2015-04-16T04:31:55-07:00 | edited 2015-04-16T04:33:53-07:00

Market Level 4Community Level 9
1873 posts

I got it. 

Thanks dave. I just came back to say I got it worked out.

FGL is the BEST!!!!

posted 2015-04-16T05:01:01-07:00