Check property in effect filer function
<?xml version="1.0" ?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="initFilter(event);" width="700">
<mx:Script>
import mx.effects.EffectTargetFilter;
import flash.events.Event;
public function filterFunc(propChanges:Array,instanceTarget:Object):Boolean {
for (var i:uint=0; i < propChanges.length; i++){
if (propChanges[i].target == instanceTarget){
if (propChanges[i].end["x"] != undefined){
return (propChanges[i].end.x > 100);
}
}
}
return false;
}
private function initFilter(event:Event):void {
var myBlurFilter:EffectTargetFilter = new EffectTargetFilter();
myBlurFilter.filterFunction=filterFunc;
myBlur.customFilter=myBlurFilter;
myUnBlur.customFilter=myBlurFilter;
}
</mx:Script>
<mx:states>
<mx:State name="One">
<mx:SetProperty target="{p1}" name="x" value="110"/>
<mx:SetProperty target="{p1}" name="y" value="0"/>
<mx:SetProperty target="{p1}" name="width" value="500"/>
<mx:SetProperty target="{p1}" name="height" value="210"/>
</mx:State>
</mx:states>
<mx:transitions>
<mx:Transition fromState="*" toState="*">
<mx:Sequence id="t1" targets="{[p1]}">
<mx:Blur id="myBlur" duration="100" blurXFrom="0.0" blurXTo="10.0" blurYFrom="0.0" blurYTo="10.0"/>
<mx:Parallel>
<mx:Resize duration="400"/>
</mx:Parallel>
<mx:Blur id="myUnBlur" duration="100" blurXFrom="10.0" blurXTo="0.0" blurYFrom="10.0" blurYTo="0.0"/>
</mx:Sequence>
</mx:Transition>
</mx:transitions>
<mx:Canvas id="pm" width="100%" height="100%">
<mx:Panel id="p1" title="One" x="0" y="0" width="100" height="100" click="currentState='One'" >
<mx:Label fontSize="24" text="One"/>
</mx:Panel>
</mx:Canvas>
</mx:Application>
Related examples in the same category