PDA

View Full Version : tweenmax and hexcolor tweening



vxd
July 6th, 2009, 02:56 AM
Hi,
I'm trying to tween a shape's colour. I'm using tweenmax but it doesn't seem to work.

The colour is originally orange.




TweenMax.to(bgColourMC, 2, {hexColors:{"what goes here":0x000000}});




When I test the movie the bg stays orange.

Thanks
vxd

The Dreaded
July 6th, 2009, 03:26 AM
Why not make it all into a Classic Tween and have your final BG color (the final keyframe) to what you want?

greensock
July 9th, 2009, 03:10 AM
TweenMax.to(bgColourMC, 2, {tint:0xFF0000});

Tweens the DisplayObject bgColourMC to red (0xFF0000). The hexColors special property will tween any hex color you want, but Flash requires you to keep re-applying the transform.colorTransform property of DisplayObjects for the color change to actually render. The tint special property handles all that for you automatically in TweenMax.