user1138509
user1138509

Reputation: 85

Issues to add the fade Effects in flex by dynamically

Am trying http://examples.adobe.com/flex2/inproduct/sdk/explorer/explorer.html to add the fade effects in flex by dynamically.But i cannot add the effects,here my code

<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>

Upvotes: 0

Views: 227

Answers (1)

sch
sch

Reputation: 27536

You should make the effect variable bindable:

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

This way, the value of mouseDownEffect will be updated when you set a new value ("wipeOutleft") to effect.

Upvotes: 1

Related Questions