Flex知识点

Flex窗口间函数调用

http://yecon.blog.hexun.com/30274240_d.html

[Bindable]public var callbackFunction:Function;  //回调函数    


Flex特效:

<?xml version="1.0" encoding="utf-8"?>  
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initUI()">  
  
    <mx:Style source="style.css" />  
     
    <mx:Script>  
        <![CDATA[ 
            private var handlerEnd:Boolean = true; 
            private var isReverse:Boolean = false; 
            //初始化函数 
            private function initUI():void{ 
                //指定目标对象,[]是数组定义符号 
                //[myPane]表示一个只含有一个元素的数组 
                Effect_Blur.targets = [myPanel];                
                //var arr:Array = new Array(); 
                //arr.push(myPanel); 
            } 
            //开始播放动画效果 
            internal function startBlur():void{ 
                handlerEnd = true;                
                Effect_Blur.play(); 
            } 
            //执行动画播放结束后的动作 
            internal function endBlur():void{ 
                if(handlerEnd){ 
                    //反向变化 
                    isReverse = !isReverse; 
                    Effect_Blur.play(null,isReverse);                    
                } 
            } 
            //停止按钮的动作 
            internal function stopBlur():void{ 
                handlerEnd = false; 
                Effect_Blur.end(); 
                pauseBtn.label = "暂停"; 
                //清空滤镜,消除模糊效果,将myPanel还原到原始状态 
                myPanel.filters = []; 
            } 
            //暂停按钮的动作 
            internal function pauseHandler():void{ 
                if(!Effect_Blur.isPlaying){ 
                    return; 
                } 
                if(pauseBtn.label == "暂停"){ 
                    pauseBtn.label = "继续"; 
                    Effect_Blur.pause(); 
                }else{ 
                    pauseBtn.label = "暂停"; 
                    Effect_Blur.resume(); 
                } 
            } 
        ]]>  
    </mx:Script>  
    <mx:Blur id="Effect_Blur" effectEnd="endBlur()"  
        blurXFrom="0" blurXTo="30" blurYFrom="0" blurYTo="30" duration="1500"/>  
    <mx:Panel id="myPanel" styleName="imgPanel" x="30" y="42" width="232" height="215" layout="absolute" title="图片面板">  
        <mx:Image x="0" y="10" source="tree.jpg"/>  
        <mx:Label x="0" y="109" text="walking tree"/>  
    </mx:Panel>  
    <mx:Button click="startBlur()" x="30" y="275" label="开始" width="50"/>  
     
    <mx:Button click="stopBlur()" x="124" y="275" label="停止" width="48"/>  
    <mx:Button click="pauseHandler()" x="214" y="275" label="暂停" width="48" id="pauseBtn"/>  
     
</mx:Application>  

Ref:

http://enboga.iteye.com/blog/247677


Flex4中的圆角问题


As you must be aware of that Flex 4 has different implementation of styling/ skinning, you may sometimes find it difficult to get simple styling done just like we do it in Flex3.

For example, you wish to provide a corner radius of a simple text input.

With Flex 3 it is very easy, just put cornerRadius=”XX” and you are done.

But in Flex 4 there is not parameter like cornerRadius. So now…

Even I was finding it a little annoying, but gradually I used to it. You can achive it by providing simple skinClass. In side skin class there will be  properties like radiusX and radiusY which internally manages the cornerradius thing for that component.

Actually skinclass is nothing but a wrapper class for that component. It creates number of rectangular components inside for each of the styling properties andthen as you provide the value it renders the component as you wish. So, inside skin class you will find number of rect component and each has a one mission to accomplish. Like for border you have one, for background you have one  .. like this.

It has one advantege and one disadvantage as well. Advantage is that by doing so( with skinclass implementation) you can manage all skinning issues in one place. Disadvantage is that for a small thing to achive you need to write a whole class.

cool.. happy flexing..:)
http://sukantadas.com/2011/03/03/flex-4-cornerradius-issue/
 
 

Flex4中不支持cornerRadius属性,而是提供了一种新方法:skinClass。可以参考:

http://stackoverflow.com/questions/6208525/how-to-have-a-cornerradius-on-flex-4-textinput-component

http://hi.baidu.com/dijiugan/blog/item/d883ac82124b98a66c8119ee.html


你可能感兴趣的:(function,properties,Flex,application,button,Components)