htmlactionscriptrootflashvars

How do I include flashvars in AS3?


I am brand new to AS3 and I am trying to move all of the data from an html file, into a swf. The old html file contained this coding:

<EMBED src="https://www.pandora.com:443/radio/tuner_9_2_0_0_pandora.swf" WIDTH="640" HEIGHT="528" FlashVars="_tunervar_shost=www.pandora.com">

So far from what I have learned I can use the loader, to substitute for the src. So in my swf, I have

var myLoader:Loader = new Loader();
addChild(myLoader);
var url:URLRequest = new URLRequest("https://www.pandora.com:443/radio/tuner_9_2_0_0_pandora.swf");
myLoader.load(url); 

What I can't figure out though, is how to change the FlashVars from html into AS3. I have done a bit of research and from what it sounds like, I have to use something called root. I am completely lost on how to use this, and I am not even sure if this is the correct way to script it. Can someone help explain this to me?

One other problem I am having, is for some reason, the swf I am loading is blurry. Is there any way to fix this?


Solution

  • Try appending them to the asset that you're loading:

    var url:URLRequest = new URLRequest("https://www.pandora.com:443/radio/tuner_9_2_0_0_pandora.swf?_tunervar_shost=www.pandora.com");