Flashvars allow you to get data into to your SWF file from the calling HTML.  Easy to use just add a flashvars parameter to your HTML.  I use ‘swfobject’ as follows:

<script type="text/javascript">
var flashvars = {myvar:"1234",anothervar:"some value"};
var params = {};
var attributes = {id:"main",name:"main"};
swfobject.embedSWF("flash-build/main.swf", "main", "650", "450","9.0.0", "scripts/expressInstall.swf", flashvars, params, attributes);
</script>

Then in your actionscript use:

root.loaderInfo.parameters.varname;

to reference the variable.

Leave a Comment