Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Semos

Getting Tween BlurFilterPlugin to work.

Recommended Posts

I've just started using AS & TweenLite / TweenMax. But I can't seem to get a blurFilter to apply.

 

 

I have done this so far,

 

package
{
 
//Import what I need to
 
import com.greensock.TweenLite;
import com.greensock.easing.Linear;
import com.greensock.plugins.BlurFilterPlugin;
import com.greensock.plugins.ColorTransformPlugin;
import com.greensock.plugins.TweenPlugin;
 
import org.flixel.FlxG;
import org.flixel.FlxState;
import org.flixel.plugin.photonstorm.FlxSpecialFX;
 
TweenPlugin.activate([blurFilterPlugin]);
 
 
 
 
public class ScreenTwo extends FlxState
{
 
private var Bwain:Brain;
private var bg1:BackgroundOne;
 
//Active plugins
TweenPlugin.activate([blurFilterPlugin, ColorTransformPlugin]);
 
override public function create():void
{
super.create();
 
Bwain = new Brain(0,0);
bg1 = new BackgroundOne(0,0);
FlxG.addPlugin(new FlxSpecialFX);
 
 
//Here I try to tween it.
TweenLite.to(bg1, 3, {blurFilter:{blurX:10, blurY:10}});
TweenLite.to(Bwain, 10,{x:-120, ease:Linear.ease});
add(bg1);
add(Bwain);
 
makeRed();
}
 
private function makeRed():void
{
//TweenMax.to(Bwain,4, {ColorMatrixFilter:{colo
}
}
}
 
 
 
When I run it, the Linear tween works fine, but during the duration of the blur tween the program looks frozen and resumes after 3 second.

 

Link to post
Share on other sites

Hi and welcome to the GreenSock forums.

 

It's hard to tell by your code what bg1 is.

 

I'm guessing it might be a flixel object.

BlurFilterPlugin only works on display objects that support filters.

Link to post
Share on other sites

Hi, and ty.

 

Oops, yeah it's an FlxSprite. My misinterpretation of the tool.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×