Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using FlashVars

Explorer ,
May 27, 2009 May 27, 2009

Once again being thrown (gladly) new stuff to process, and learn, and with anything new I need some help.

I had to convert an AS2 clicktag script to AS3. It complies and works locally, but I was told I need to use

the FlashVars to embed/place  a variable (a URL) in the swf before it even starts.

This is something I haven't experimented with (yet)

I've seen examples and I kind of understand it, but I was hoping on some clarification

var flashVars=root.loaderInfo.parameters;

I understand the dot synatx (enjoy using it), and the root is probably the begining (where it will place the sting)

Im a bit confussied on the loaderinfo and the parameters what are here functions in the command.

var clickTAG = flashVars["clickTAG"];

then using the flashVars Im unsure on the use of square brackets (instead of using curly braces)

Best guess:

This will take the string passed to it "a url" clickTAG and use the flashvars to embed/place it in the root/begining tagged as "clickTAG"?

(did I come close on that one)

Sorry for what may seem breaking it down to an over simplified explanation, If it will be to long of an explanation, web links that may simplfy

it would be apprciated as well

Thanks for any help

TOPICS
ActionScript
669
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 27, 2009 May 27, 2009

If you Google "AS3 FlashVar" you'll find a number of explanations.  Here's one that got me thru the forest.

http://blog.six4rty.ch/tutorials/flash-flashvars-in-as3/

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 27, 2009 May 27, 2009
LATEST

you're variable names are  not the best and my lead to some confusion although it's just a name.

but root.loadInfo.parameters is an object into which all flashvar variable names and values are passed.

so:

var flashvarsObj:Object=root.loaderInfo.parameters;

for(var s:String in flashvarsObj){

trace(s,flashvarsObj);

}

will trace the variable name, variable value

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines