易截截图软件、单文件、免安装、纯绿色、仅160KB

FLEX实践—动态切换应用皮肤

     在同一个Application中动态切换主题,这里采用的是动态引用不同的CSS文件。
      具体步骤如下:
     1)创建CSS文件
      skyTheme.css
      /* CSS file */
.backgroudSkin
{
   backgroundColor: #89caec;
   fontWeight:bold;
 fontSize:12;
}
.applicationBar
{
    cornerRadius:20; 
    stype:solid;
    fillAlphas:0.42, 0.42;
}
     treeTheme.css
/* CSS file */
.backgroudSkin
{
   backgroundColor: #bee38a;
   fontWeight:bold;
 fontSize:12;
}
.applicationBar
{
    cornerRadius:5; 
    fillAlphas:0, 0;
}
   2)将每一个CSS文件右键选择"Compile CSS to SWF"
   3)创建ThemeTest.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" styleName="backgroudSkin">
 <mx:Script>
   <![CDATA[
     import mx.styles.StyleManager;
     private var style:String;
    
     private function changeTheme(theme:String):void{
      //切换CSS文件
      StyleManager.loadStyleDeclarations(theme, true);
      
     }
   ]]>
 </mx:Script>
 <mx:ArrayCollection id="skinCollection">
      <mx:Object label="SkyTheme" data="theme/skyTheme.swf"/>
      <mx:Object label="TreeTheme" data="theme/treeTheme.swf"/>
    </mx:ArrayCollection>
 <mx:ApplicationControlBar x="10" y="10" width="100%" height="50" styleName="applicationBar">
  <mx:ComboBox id="skinSelect


相关文档:

flex鼠标移到某组件鼠标的形状变成手型

 比如我要设置当鼠标移动到label上时,鼠标形状变成手型
具体代码
<mx:Label text="click me"  
    useHandCursor="true"    
    buttonMode="true"    
    mouseChildren="false"/>
只要设置:
use ......

用flex如何显示数字时钟

 通过Flex中的Timer可是实现数字时钟的效果,其效果图如下:
实现的代码如下:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

<mx:Script>
<!--[CDATA[

import mx.formatters.DateFormatt ......

个人总结flex应用 II【经典】

Mxml组件的打开和关闭特效
openDuration="1000" openEasingFunction="Bounce.easeOut"
closeDuration="1000" closeEasingFunction="Bounce.easeIn"
//菜单透明效果
background-color:#000000;
background-alpha:0.1;
border-style:solid;
drop-shadow-color:#000000;
drop-shadow-enabled:yes;
//展开所 ......

Flex表单中回车下移焦点的方法

对于习惯了使用桌面应用程序的用户而言,回车后下移焦点到下一个编辑组件中的小功能,是非常贴心的,利用flex中的KEY_DOWN事件可以方便的实现回车下移焦点,代码如下:
 <?xml version="1.0" encoding="utf-8"?>
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplet ......

flex xml和arraycollection相互转换

1、arraycollection转化为xml,代码如下:
    
    //动态生成树形结构
public static function flatArrayToXML(arr:Object,rootname:String=null,nodename:String=null, outputString:Boolean=false):Object{
if (arr is Array){

......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号