当前位置: 动力学知识库 > 问答 > 编程问答 >

flex3 - How to get a collection of UIComponents based on a stylename in Adobe Flex

问题描述:

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

网友答案:

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_states/

分享给朋友:
您可能感兴趣的文章:
随机阅读: