Flex4 - 运行时动态加载外部css文件
作者:hangge | 2015-02-03 11:19
flex开发中,有时需要给程序设计多套style皮肤样式,供用户选择切换,可进行如下操作:
3,卸载样式
1,将css文件编译成swf
2,flex中加载外部样式
//单个直接加载
styleManager.loadStyleDeclarations("style.swf");
//多个的话最后一个再指定立刻生效,节约资源
styleManager.loadStyleDeclarations("styleA.swf",false);
styleManager.loadStyleDeclarations("styleB.swf",false);
styleManager.loadStyleDeclarations("styleC.swf",true);
3,卸载样式
styleManager.unloadStyleDeclarations("style1.swf");
全部评论(0)