A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Tween filter properties using Tweener

  1. #1
    mafioso
    Join Date
    Apr 2008
    Location
    Louisville, KY
    Posts
    9

    Tween filter properties using Tweener

    Someone please help...

    I am trying to tween the BlurFilter's properties (or any other filter's properties) using Tweener. Please tell me why my code is not working.

    Code:
    var bf:BlurFilter = new BlurFilter(10,10,3);
    
    var aFilters:Array = new Array(bf);
    mc.filters = aFilters;
    
    mc.addEventListener(MouseEvent.MOUSE_OVER,doBlur);
    
    function doBlur(e:Event):void
    {
         Tweener.addTween(mc,{blurX:0,blurY:0,time:1,transition:"linear"});
    }

  2. #2
    OOP is one letter from OOPS kortex's Avatar
    Join Date
    Aug 2005
    Location
    New Hope, PA
    Posts
    2,668
    Never used tweener, but my guess would be that if it is expanding upon the built in tween classes, the property you are tweening has to be a property of the clip that the tween is applied to. blurX and blurY if i remember correctly are actually properties of the blur filter, not the clip itself.
    Jeremy Wischusen
    Flash - Flex - LAMP - Web Developer Purple Inc
    AS OOP FAQ-Best Practices Thread | Flashkit OOP Tutorials | Purple Inc (day job) | Blog


  3. #3
    mafioso
    Join Date
    Apr 2008
    Location
    Louisville, KY
    Posts
    9
    Okay, actually I found the answer in the documentation. You have to use the filter shortcuts.

    import caurina.transitions.properties.FilterShortcuts;
    FilterShortcuts.init();
    Then you can tween the filter properties like this:

    Tweener.addTween(mc,{_Blur_blurX:0,_Blur_blurY:0,t ime:1,transition:"linear"});

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center