问题通过动态

问题描述:

我试图通过http://examples.adobe.com/flex2/inproduct/sdk/explorer/explorer.html向dynamically.But中添加柔性渐变效果我不能添加的影响,在这里我的代码问题通过动态

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init();"> 
<mx:Script> 
    <![CDATA[ 
     private var effect:String; 
     private function init():void { 
     effect="wipeOutleft"; 
     } 
    ]]> 
</mx:Script> 
<mx:WipeLeft id="wipeOutleft" duration="1000"/> 
<mx:Image id="img" source="@Embed(source='assets/image002.png')" mouseDownEffect="{effect}" width="254" height="259"/> 
</mx:Application> 

你应该让effect变量绑定添加淡入淡出效果的柔性:

[Bindable] 
private var effect:String; 
// ... 

这样,当你设置一个新的值("wipeOutleft")到effectmouseDownEffect值将被更新。

+0

它的工作很好,谢谢 – user1138509 2012-03-03 13:45:12