Jump to content
GreenSock

Infinite

Minor issue with MotionBlur and Flash/Flex Hybrid project

Recommended Posts

I found an interesting bug/issue with the TweenMax MotionBlur Plugin and and Flex/Flash hybrid project. I'm working on a pretty big project. We use Flash for our primary platform, and we also use Flex to build tools for our artists and other content team members. The Views are all coded for the Flash Player, but in the tools we utilize the Flex framework for components. I was working on a piece in the editor (Flex part) and I noticed that when I enabled the MotionBlur plug-in in my feature my Sprite would disappear. After digging into the problem I just changed the line below and it fixed the issue (lucky stab in the dark) :D.

 

//from line 220 of MotionBlurPlugin.as
/** original code **/_sprite = _isFlex ? new (getDefinitionByName("mx.core.UIComponent"))() : new Sprite();
_sprite = new Sprite(); // new line

 

I'm guessing that I am in the minority, but I thought I would share. Maybe there is a better way to define if your project wants the Flash or Flex name spacing instead of trying to cleverly guess, or having an easy override. It looks like only 3 Plug-in's use the '_flex' var. If I used the code above my project works, but it's one of those things that we have to remember not to blow out if we update TweenMax before the next feature launches. It would be more ideal if you could set a Flex/Flash override in the TweenMax API. :D

 

-i

Link to comment
Share on other sites

That's pretty odd - you said it just disappeared? I'm not sure why using a UIComponent instead of a Sprite would make something disappear, but I just uploaded a new version of MotionBlurPlugin that recognizes a new [optional] containerClass property so you can define the type of instance you want to use for the container. For example:

 

TweenMax.to(mc, 2, {x:400, motionBlur:{strength:1.2, containerClass:Sprite}});

 

Does that help?

Link to comment
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.
×