NewSourceMedia on Facebook

AS3 Blur Filter with Tweener class

Share Bookmark and Share

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/

Please rate this post by clicking a star:

(1 votes, average: 4.00 out of 5)

Leave a Reply