Hello,
Heres a quick code snippet that you can use to get parameters in the url which a swf is hosted on.
E.G: http://mysite.com/myGreatSWF.swf?paramName=paramValue
Code Snippet:
trace(this.loaderInfo.parameters.paramName);
// outputs "paramValue", if the url is "http://mysite.com/myGreatSWF.swf?paramName=paramValue"
loaderInfo.parameters contains a Object with all the parameters in the url requesting the swf, you could use "swfname.swf?test=thetestvalue" for instance, and get it in the swf file using "loaderInfo.parameters.test"
You should also check if the query (test in this case) exists, in order to avoid errors.
Cool! I like your tutorials, can you show me how to check if it exists?? Thanks
ReplyDeleteYou can use an IF statement, like if(myVar != null)
ReplyDelete