Trying to get variables into flash from the browser!

Ever wondered how to get variables from an html page to a flash element?

Well, it’s quite easy using the following actionscript 2 example:

I use javascript to embed my flash elements:

<embed src=”somefilename.swf?varname=varvalue&vartwo=var2value” width=”550″ height=”400″></embed>

Now in Flash I can just call:

_root.varname and it will give us `varvalue`
_root.vartwo will give us `var2value`

Wasn’t that easy?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>