tags:

views:

36

answers:

1

Does anyone know an Actionscript equivalent of the javascript getElementsByClassName.

What I would like to do is add a custom 'stylename' to various components which I can then use to get a collection of these objects and therefore process their visibility property.

The idea is I want to hide various components based on what roles a logged in user has - I just want to make this flexible by adding an array of rolenames to a custom property or use the stylename property on a Canvas or Panel etc.

Thanks

A: 

I think your best bet is to use flex states. A base state with the differences specified in sub states. heres a nice tutorial from adobe on flex states assuming you're using flex 3.x : http://www.adobe.com/devnet/flex/quickstart/creating%5Fstates/

greg
Thanks Greg - not really what I was after as I need a far amount of granularity and reuse. Besides I want to build a reusable framework and states are defined on a per application basis.
Mark Barton