When I updated Penner's color classes from his Programming Flash MX book to AS2, I also translated all of the methods and classes to work with the ColorTransform object.
There's one class in particular the ColorTransformClip that adds several getters and setters to a MovieClip or all MovieClips that you could then use the Tween class or any other tween classes on. You can view and download these classes and documentation from here: http://www.digitalflipbook.com/archives/2006/08/penner_as2_prof_7.php or all of Penner's classes updated to AS2 from here: http://www.digitalflipbook.com/downloads/flash/penner/Penner_AS2_ProFMX.zip - Mark Walters www.digitalflipbook.com On 9/23/06, Dan Rogers <[EMAIL PROTECTED]> wrote:
Thanks for the suggestion. I took a look at their code, and it looks like they are still using the older Color object syntax. I am simply looking to see if it's possible to tween using the ColorTransform class. -Danro On Sep 23, 2006, at 5:32 PM, Charles Parcell wrote: > I am going to point you to the API I was recently introduced to. > Fuse Kit. > > http://www.mosessupposes.com/Fuse/ > > > Charles P. > > > > On 9/23/06, Dan Rogers <[EMAIL PROTECTED]> wrote: >> >> Hey Flashcoders, >> >> Has anyone here attempted to tween the Flash 8 ColorTransform class? >> I am having some strange issues while trying to tween some >> ColorTransform objects using Grant Skinner's MultiTween class. Seems >> that whenever I tween a ColorTransform object which contains yellow >> (?), I get a random spectrum of colors before the tween reaches it's >> target value. I've posted the source and have included the AS >> below. I realize there are other color-tweening scripts out there, >> but I was trying to use the ColorTransform class to see if it could >> be done. >> >> Source: >> http://download.danro.net/flashcoders/color_tween_test.zip >> >> Thanks, >> -Danro >> >> >> code follows ---------------------- >> >> import com.gskinner.transitions.MultiTween; >> import flash.geom.Transform; >> import flash.geom.ColorTransform; >> import mx.transitions.easing.*; >> import mx.transitions.Tween; >> import mx.utils.Delegate; >> >> // color transform objects >> var originColor:ColorTransform = new ColorTransform(); >> var currentColor:ColorTransform = new ColorTransform(); >> var rollOverColor:ColorTransform = new ColorTransform(); >> rollOverColor.rgb = 0xFFCC00; >> var rollOutColor:ColorTransform = new ColorTransform(); >> rollOutColor.rgb = 0x0066CC; >> >> // movieclip transform >> var trans:Transform = new Transform(test_mc); >> >> // update color function >> function updateColor () { >> trans.colorTransform = currentColor; >> debug("DEBUG >> " + trans.colorTransform); >> } >> >> // set vars >> var colorTween:Tween; >> var mTween:MultiTween; >> >> // rollover tween >> function buttonRollOver () { >> mTween = new MultiTween(currentColor, rollOverColor); >> colorTween.stop(); >> colorTween = new Tween(mTween, "position", >> Regular.easeOut, 0, 1, >> 20); >> colorTween.onMotionChanged = Delegate.create(this, >> updateColor); >> debug("DEBUG >> --------- roll over -----------"); >> } >> >> // rollout tween >> function buttonRollOut () { >> mTween = new MultiTween(currentColor, rollOutColor); >> colorTween.stop(); >> colorTween = new Tween(mTween, "position", >> Regular.easeInOut, 0, >> 1, >> 20); >> colorTween.onMotionChanged = Delegate.create(this, >> updateColor); >> colorTween.onMotionFinished = Delegate.create(this, reset); >> debug("DEBUG >> --------- roll out -----------"); >> } >> >> // reset color to original >> function reset () { >> mTween = new MultiTween(currentColor, originColor); >> colorTween.stop(); >> colorTween = new Tween(mTween, "position", >> Regular.easeInOut, 0, >> 1, >> 30); >> colorTween.onMotionChanged = Delegate.create(this, >> updateColor); >> debug("DEBUG >> --------- reset -----------"); >> } >> >> // button events >> test_mc.onRollOut = Delegate.create(this, buttonRollOut); >> test_mc.onRollOver = Delegate.create(this, buttonRollOver); >> >> // debug function >> function debug (txt:String) { >> //trace(txt); >> } >> >> _______________________________________________ >> [email protected] >> To change your subscription options or search the archive: >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> >> Brought to you by Fig Leaf Software >> Premier Authorized Adobe Consulting and Training >> http://www.figleaf.com >> http://training.figleaf.com >> > _______________________________________________ > [email protected] > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com _______________________________________________ [email protected] To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
_______________________________________________ [email protected] To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com

