Edit: I\'ve come to realize the main problem I\'m facing is that I want a text field that already exists in a movieclip or on the stage to take the string from a flashvar. F
I've been wasted all the day long for that...
AS3:
var uid:String;
// your code
this.loaderInfo.addEventListener(Event.COMPLETE, loaderComplete);
// your code
function loaderComplete(e:Event=null):void
{
var fv = stage.loaderInfo.parameters;
uid = fv['uid'] || "'uid' not found";
}
HTML:
<object type='application/x-shockwave-flash' data='/flash/yourSWF.swf' width='320' height='240'>
<param name='wmode' value='transparent' />
<param name='FlashVars' value='uid=yourData' />
<param name='movie' value='/flash/yourSWF.swf' />
</object>
If you are still having this problem, follow below lines. I used flash vars, they work fine for me.
My html script was:
<html>
<body>
<div id="flashContent">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"FlashVars="uid=123&name=santhu" width="100%" height="100%" id="index" align="middle">
<param name="movie" value="index.swf" />
<param name=FlashVars value="uid=123&name=santhu">
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="index.swf"
FlashVars="uid=123&name=santhu" width="100%" height="100%">
<param name="movie" value="index.swf" />
<param name=FlashVars value="uid=123&name=santhu">
<!--<![endif]-->
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</body>
</html>
and my AS code to load vars is
this.root.loaderInfo.addEventListener(Event.COMPLETE, SWFLoadComplete);
private function SWFLoadComplete(e:Event)
{
obj=this.root.loaderInfo.parameters;
trace(obj.uid , obj.name); // outputs: 123 santhu
}
Try this: stage.loaderInfo.parameters.yourparam
or stage.loaderInfo.parameters["yourparam"]
Can you post your html code, so we can see how you pass the flashvars to Flash.