2011-05-04 21 views
0

我有兩個不同的樣式表一個Flex移動項目:變革之間2樣式表動態的Flex

  • theme1.css(包含所有主題1的CSS)
  • theme2.css(包含所有的CSS爲主題2)

該項目需要一次只導入一個樣式表。

如何創建一個在兩個樣式表之間切換並刷新屏幕的按鈕?

感謝 菲爾

回答

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,通過rightclicking在Flash Builder中捲餅的文件,並檢查編譯的SWF選項