views:

593

answers:

1

I have a few object params in HTML page I like to enumerate, what is the easiest method?

I would like to use for loop to go through each param and insert them into my own Array.

+2  A: 

If you are referring to the parameters of the <object> element (such as allowfullscreen, wmode, quality, etc.), I don't think there is a generic way of accessing these values from within AS3. To access these values, I guess you probably need to have some sort of mechanism outside flash to pass these parameters to the flash object. E.g., you could use SWFObject to generate the embedding code, and pass the array meant to be used as params in the flashvars argument as well.

If, on the other hand, you mean the value of the flashvars parameter, i.e., those values which are meant to be passed to the flash object, you can access these values via the Applicaiton.application.paramaters object (keys are parameter names, values are corresponding values). In case of a plain AS3 project, the same array can be accessed via root.loaderInfo.parameters.

HTH

David Hanak
I like root.loaderInfo.parameters [x];
Tom