[Tweener] Tweener wipes out child object blendmodes?
Zeh Fernando
zeh at zehfernando.com
Wed Jul 9 20:34:17 PDT 2008
> When Tweener is used to blur an object, I noticed any and all
> blendmodes (e.g. multiply) applied to objects WITHIN the object are
> reset.
>
> Once tweened, attempting to re-apply the blendmode to those objects
> fails, even by force (e.g. enterframe).
>
> Note that the same object blurred with conventional AS maintains the
> blendmode of child objects.
>
> Examples:
>
> object[child].blendMode = BlendMode.MULTIPLY; object.blurY = 100; //
> maintains the blendmode!
>
> -vs-
>
> object[child].blendMode = BlendMode.MULTIPLY;
> Tweener.addTween(object,{_
> blur_blurY:100,time:0.5,delay:0.2,transition:Equations.easeInExpo});
> //wipes out the blendmode!
>
> Has anyone else noticed this? Any suggestions for working around it?
> Cheers!
It's a known issue and it's how Flash works. If you apply a filter to an
object, all of its content is flattened (it's as if it turns into a
single image), so blending modes that affect objects outside of the main
object are lost and adopt the main object's own blending mode.
> Note that the same object blurred with conventional AS maintains the
> blendmode of child objects.
> object.blurY = 100; // maintains the blendmode!
Are you REALLY sure of that? That one line does nothing, so maybe that's
why it looks like it 'maintains' the blending mode. Trying to apply a
filter by the normal means (adding a BlurFilter to the main object's
.filter property array) without Tweener will give you the same result
and you'll lose special blending modes used on its children.
Anyway, there's a number of semi-solutions, but it depends on what
you're doing.
You can blur each child object individually (this is usually the best
solution, but it depends on the number of children objects you have).
You can also adopt a single blending mode that still works for all your
objects and apply it to the main object container (not feasible if
children vary in color too much or if the background is not nearly opaque).
Zeh
More information about the Tweener
mailing list