Check property in effect filer function : Effect « Effects « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Effects » EffectScreenshots 
Check property in effect filer function
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
1.Creating an instance of an effect using pure ActionScriptCreating an instance of an effect using pure ActionScript
2.Creating a reusable effect in ActionScript with Move classCreating a reusable effect in ActionScript with Move class
3.Define effect in MXML, use ActionScript to apply itDefine effect in MXML, use ActionScript to apply it
4.Effect With ActionScript
5.Use ActionScript to play EffectUse ActionScript to play Effect
6.Grouping effects and playing them one after anotherGrouping effects and playing them one after another
7.Playing multiple effects at the same timePlaying multiple effects at the same time
8.Use a class selector to apply effectsUse a class selector to apply effects
9.Using MXML to define the effectUsing MXML to define the effect
10.Applying behaviors using the Effect.target and Effect.targets propertiesApplying behaviors using the Effect.target and Effect.targets properties
11.Setting effect durationsSetting effect durations
12.Add show effect to a controlAdd show effect to a control
13.Play effect for more than one controlsPlay effect for more than one controls
14.Set effect targetSet effect target
15.Reverse an EffectReverse an Effect
16.Pause an EffectPause an Effect
17.Composite EffectsComposite Effects
18.Enable Composite EffectsEnable Composite Effects
19.Using the Pause effect to pause between two other effectsUsing the Pause effect to pause between two other effects
20.Using easing functions with the Move effect to make motion less linearUsing easing functions with the Move effect to make motion less linear
21.rollOverEffect and rollOutEffectrollOverEffect and rollOutEffect
22.Create, configure, and apply effects to Flex componentsCreate, configure, and apply effects to Flex components
23.Mouse down effect for an Image controlMouse down effect for an Image control
24.specify the mx.effects.easing.Bounce.easeOut() method to the Accordionspecify the mx.effects.easing.Bounce.easeOut() method to the Accordion
25.Chart show data effectChart show data effect
26.SeriesInterpolate effectSeriesInterpolate effect
27.Apply Shadow effectApply Shadow effect
28.Insertion's effect on the Array and the ArrayCollection representation of the ArrayInsertion's effect on the Array and the ArrayCollection representation of the Array
29.Applying MX effects in MXMLApplying MX effects in MXML
30.List Effect Custom and Default EffectsList Effect Custom and Default Effects
31.Easing function that creates a bounce motion when combined with the Flex Move effectEasing function that creates a bounce motion when combined with the Flex Move effect
32.Repeat EffectsRepeat Effects
33.Applying transform effectsApplying transform effects
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.