2个样式表之间的更改动态弹性

时间:2011-05-04 10:15:59

标签: flex actionscript air

我有一个Flex移动项目,有两个不同的样式表:

  • theme1.css(包含主题1的所有css)
  • theme2.css(包含主题2的所有css)

项目一次只需导入一个样式表。

如何创建一个在两个样式表之间切换并刷新屏幕的按钮?

由于 菲尔

1 个答案:

答案 0 :(得分:1)

    switch (this.themeSelected) { 
                case 0: 
                    this.styleManager.loadStyleDeclarations("../light.swf", true);
                    break ; 
                case 1: 
                    this.styleManager.loadStyleDeclarations("../alt.swf", true);
                    break ; 
                case 2: 
                    this.styleManager.loadStyleDeclarations("../dark.swf", true);
                    break ; 
                case 3: 
                    this.styleManager.loadStyleDeclarations("../impaired.swf", true);
                    break ; 

    }

您需要将您的css编译为swf,方法是右键单击Flash Builder Burrito中的文件并检查编译为SWF选项