GO Tweening System
Posted: November 13, 2007 at 12:56 pmCheck the most recent Go post for updates to HydroTween
I finally got a chance to play with Moses' new AS3 tweening system "GO". It's very, very cool, and very powerful. The only drawback to this is it takes a bit more work and is a little more advanced then the average tweening engine. However for advanced developers comfortable with customizing and modifying a tweening engine, GO will be a natural solution especially for big projects.
Go here for updates and info on the GO System.
I'm looking forward to seeing what other people come up with and how they extend the functionality of GO. This was a simple example but I plan on abstracting out the array tweening function so it can be used in other situations. Hopefully people will catch on to this and a library of extensions will develop. I think once that happens it will become very accessible to all developers.
Here's the current code example:
import com.hydrotik.go.SepiaTween; import org.fuseproject.go.events.GoEvent; import fl.motion.easing.Sine; // Add Interaction image.addEventListener(MouseEvent.CLICK, imageHandler); image.buttonMode = image.mouseEnabled = image.useHandCursor = true; var isSepia:Boolean = false; // Setup our sepia matrix var sepiaColor:Array = [ 0.3930000066757202, 0.7689999938011169, 0.1889999955892563, 0, 0, 0.3490000069141388, 0.6859999895095825, 0.1679999977350235, 0, 0, 0.2720000147819519, 0.5339999794960022, 0.1309999972581863, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1 ]; var nullColor:Array = [ 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1 ]; // Setup GO var oGo:SepiaTween = new SepiaTween(image, sepiaColor, 0, 3, Sine.easeInOut); oGo.addEventListener(GoEvent.START, goHandler); oGo.addEventListener(GoEvent.UPDATE, goHandler); oGo.addEventListener(GoEvent.END, goHandler); // Handlers function imageHandler(event:MouseEvent):void{ oGo.matrix = (isSepia) ? nullColor : sepiaColor; oGo.start(); isSepia = !isSepia; } function goHandler(event:GoEvent):void{ switch (event.type) { case GoEvent.START: trace("start"); break; case GoEvent.UPDATE: trace("update"); break; case GoEvent.END: trace("end"); break; } }
GO Sepia Source
HydroTween 0.4.4 Source and Example
Check the most recent Go post for updates to HydroTween
I finally got a chance to play with Moses' new AS3 tweening system "GO". It's very, very cool, and very powerful. The only drawback to this is it takes a bit more work and is a little more advanced then the average tweening engine. However for advanced developers comfortable with customizing and modifying a tweening engine, GO will be a natural solution especially for big projects.
Go here for updates and info on the GO System.
I'm looking forward to seeing what other people come up with and how they extend the functionality of GO. This was a simple example but I plan on abstracting out the array tweening function so it can be used in other situations. Hopefully people will catch on to this and a library of extensions will develop. I think once that happens it will become very accessible to all developers.
Here's the current code example:
import com.hydrotik.go.SepiaTween; import org.fuseproject.go.events.GoEvent; import fl.motion.easing.Sine; // Add Interaction image.addEventListener(MouseEvent.CLICK, imageHandler); image.buttonMode = image.mouseEnabled = image.useHandCursor = true; var isSepia:Boolean = false; // Setup our sepia matrix var sepiaColor:Array = [ 0.3930000066757202, 0.7689999938011169, 0.1889999955892563, 0, 0, 0.3490000069141388, 0.6859999895095825, 0.1679999977350235, 0, 0, 0.2720000147819519, 0.5339999794960022, 0.1309999972581863, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1 ]; var nullColor:Array = [ 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1 ]; // Setup GO var oGo:SepiaTween = new SepiaTween(image, sepiaColor, 0, 3, Sine.easeInOut); oGo.addEventListener(GoEvent.START, goHandler); oGo.addEventListener(GoEvent.UPDATE, goHandler); oGo.addEventListener(GoEvent.END, goHandler); // Handlers function imageHandler(event:MouseEvent):void{ oGo.matrix = (isSepia) ? nullColor : sepiaColor; oGo.start(); isSepia = !isSepia; } function goHandler(event:GoEvent):void{ switch (event.type) { case GoEvent.START: trace("start"); break; case GoEvent.UPDATE: trace("update"); break; case GoEvent.END: trace("end"); break; } }
GO Sepia Source
HydroTween 0.4.4 Source and Example