您的位置:首页 > 移动开发

如何创建自定义主题

2008-03-27 23:00 375 查看
如何创建自定义主题

1.       先创建一个css文件,例如:myTest.css

myTest.css文件如下:

global{

       fontSize:12;

       fontfamily: "_sans", Arial;

}

Application{

       backgroundGradientColors: #006699, #AEB4E6;

       backgroundImage: Embed(source="Bg.jpg");

}

Panel{

       borderColor: #AEB4E6;

       borderAlpha: 1;

}

Button {

   cornerRadius: 0;

   fillColors: #ffffff, #aeb4e6, #ffffff, #eeeeee;

   color: #555c91;

}

LinkBar {

   borderStyle: none;

   backgroundColor: #ffffff;

   rollOverColor: #cdd0e9;

   selectionColor: #a1a7d2;

   color: #545da9;

   textRollOverColor: #6168a1;

   textSelectedColor: #6c719f;

}

2.       在环境变量:path中加入flex的编译环境

如:C:/Program Files/Adobe/Flex Builder 2/Flex SDK 2/bin

3.       进入命令提示符,切换到你所建工程目录下,

例如:cd E:/aaa

4.1  用flex的编译器编译:

              Compc  -include-file   myTest.css   myTest.css   -include-file   bj.jpg bj.jpg    -o    myStyle.swc

 

-include-file 有两个参数,名称和路径,

-o  表示生成的swc文件名

 

4.2  用flex的编译器编译XML文件,来达成目的

        新建myTest.xml文件

         <?xml version="1.0"?>

<flex-config xmlns="http://www.adobe.com/2006/flex-config">

                   <output>myTest.swc</output>

                   <include-file>

                       <name>myTest.css</name>

                       <path>myTest.css</path>

                   </include-file>

                   <include-file>

                       <name>Bg.jpg</name>

                       <path>Bg.jpg</path>

                   </include-file>

</flex-config>

                    

                     Compc –load-config myTest.xml

       5. 选择你所建的那个工程,右击选择propertise

弹出的窗口中,选择左侧的”Flex Compiler”项,设置flex编译器选项

在“Additional compiler arguments”项下的输入框中,加入

-locale en_US -theme myTest.swc
特别注意一点: 
 
新创建的主题文件可以拷贝到任何程序中使用,主题文件和程序没有任何关联。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息