How do you dynamically load a CSS file into a Flex application?

前端 未结 4 830
无人共我
无人共我 2020-12-19 09:12

I know that you can apply CSS in order to style objects in Flex using the StyleManager:
http://livedocs.adobe.com/flex/3/html/help.html?content=styles_07.html

4条回答
  •  情书的邮戳
    2020-12-19 09:17

    The application of CSS in Flex is handled on the server side at compilation and not on the client side at run time.

    I would see two options then for you (I'm not sure how practical either are):

    1. Use a server side script to compile your CSS as a SWF then load them dynamically.
    2. Parse a CSS Style sheet and use the setStyle functions in flex to apply the styles. An similar example to this approach is the Flex Style Explorer where you can check out the source.

    Good luck.

提交回复
热议问题