AS3 Blur Filter with Tweener class

Here’s how to add blur filters when using Tweener. The example below uses a movie clip with the instants name “mc1″. Make sure you change it to match the movie clip in your flash file.

// Import Filters
import flash.filters.*;
// Import Tweener
import caurina.transitions.Tweener;
// Import Tweener propertie shortcuts
import caurina.transitions.properties.FilterShortcuts;
// *** Very Importaint *** : Initialize shortcuts
FilterShortcuts.init();
// Blur x and y at 10px in 1 second using linear transition
Tweener.addTween (mc1, {_Blur_blurX: 10, _Blur_blurY: 10, _Blur_quality:2, time:1, transition:"linear"});

Note there was a change in the Tweener class so you may have to change the “B” to a lower or upper case depending on what version of Tweener you have:

Upper case B: _Blur_blurX
lower case b: _blur_blurX

Download a working sample here:
http://tweener.googlecode.com/

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Next Post » »