var myStr:String = root.loaderInfo.parameters.benny;
//this code will recieve single value from flashVars.
I want to know how to use LoaderInfo.parameters for handle more number of data?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The loader variables are captured by flash either by get variables inside the URL or by flashvars. You’ve got it exactly right, its key/value pairs. So basically if you had a URL like this:
Inside flash you access these just like you’ve already been doing:
If you were to trace out the above values, it will show:
Heres a link that describes doing the same thing using flashvars:
http://blogs.adobe.com/pdehaan/2006/07/using_flashvars_with_actionscr.html
Note I use the statement “as String” or “as Number” because by default the values are properties of an Object called “parameters.” Doing what I’m doing above explicitly casts these values as the desired type, which is prudent for both optimal VM performance and just plain good coding practice.