As3 flashvars

Everybody knows that FlashVars are pretty useful when you want to work with dynamic data being passed from the URL or from the object tags, that gives you a bit of a dynamic touch to your application as well allows you to shorten out your delivery time since you can create your flash object only once, for example you want to publish 100′s of videos like youtube does for example, but you don’t want to create for every clip a single swf.. Believe me there are people out there that are still doing that. If you don’t have a big ass database like most web 2.0 sites have, then flash vars is the intermediate solution.[ad code=4 align=center]

Actionscript 2.0:
While we’re still scripting AS 2.0 in flash 8, we could just define an empty variable in our first frame, and the values being passed from the URL or through the Embed object were passed to our flash movie.

In the example below I’ve created a swf that it’s getting the content of it’s textfield through FlashVars using Actionscript 2.0
Example:

var lang;
var paramList:Object = this.root.loaderInfo.parameters;
if(paramList["lang"]==undefined){
 
 trace('null');
 lang='en';
} else{
 lang=paramList["lang"];
}

more info http://cookbooks.adobe.com/post_Reusable_flashvars_class-17037.html

Leave a comment