PDA

View Full Version : Iterate through Static Variables


arkum
09-24-2008, 10:12 AM
Hi,

I have a class that contains all static variables. How can I iterate through them?

Thanks

rawmantick
09-24-2008, 10:54 AM
Make a static array with values. Why do you really need it ?

arkum
09-24-2008, 11:10 AM
I have an Embedded Assets class containing all my apps embedded assets as static vars. I want to be able to interogate the class through a getAssets():Array function and have it return all its static vars.

I don't understand what you mean by 'make a static array with values'? I want to iterate through the static vars of the class, not put them in an array by hand.

rawmantick
09-24-2008, 11:47 AM
prettu weird way to scope assets... I'd better put them int swc.

Actually as I know - NO, you cannot iterate through static properties of class...

Correct me if i'm wrong.

lordofduct
09-24-2008, 01:59 PM
So you want the class to have a getAssets method that returns an Array?


getAssets():Array


that looks like you're sticking them in an array. They're static, stick them in. You only have to write the code to stick them in an array once, what is there like 100 properties or somethign?