[Golist] HydroTween direct method calls--not callbacks? + HydroSequence
Jud Holliday
judh at ZAAZ.com
Wed Jul 2 10:12:45 PDT 2008
Moses may be able to correct me, but I don't think there's a way to call a function directly from a sequence without setting up a tween of some sort with a callback.
This is untested, but something like:
var seq:SequenceCA = new SequenceCA();
var tween:LinearGo = new LinearGo();
tween.addCallback(myFunctionName, GoEvent.START);
seq.addStep(tweeen);
seq.start();
Maybe there is an easier way?
If you want to try using some classes outside of the core Go source, one of the classes in the ZAAZ Go Library was created for the purpose of making function calls. It's one I've mentioned in previous threads called CallbackTrigger. It would look something like this:
var seq:SequenceCA = new SequenceCA();
seq.addStep( new CallbackTrigger(myFunctionName) );
seq.start();
Of course in both examples you would have other steps in your sequence as well.
If you're interested in checking it out, it is available out on the Go Playground (as a zip or through SVN). Better examples are included.
http://code.google.com/p/goplayground/
-Jud
From: golist-bounces at goasap.org [mailto:golist-bounces at goasap.org] On Behalf Of Eric-Paul Lecluse
Sent: Monday, June 30, 2008 3:29 AM
To: Mailing list for the Go ActionScript Animation Platform
Subject: Re: [Golist] HydroTween direct method calls--not callbacks? + HydroSequence
Hey list, I'm currently using GO's SequenceCA (via an example by John Grden). In the sequence I'd like to insert a single direct functioncall, as you are doing with the fuse-named sequence below. Is that possible with a SequenceCA?
Obviously I'm very new to Go, for I can't even find the HydroTween class in the Go SVN repos.
Who'll give me a slap in the face and a kick in the right direction?
Cheers,
Eric-Paul.
On 6/27/08 17:52 , "Donovan Adams" <donovan at hydrotik.com> wrote:
As a matter of fact there is. I've been in the process of testing an update to HydroTween as well as a breakout for Fuse style sequencing which more easily extends the power of SequenceCA. My continuing plan with HydroTween is to keep everything self contained, however this really made more sense in order to take advantage of Go's flexibility. SO with that said, I've added another companion class called HydroSequence. Works like this:
import com.hydrotik.go.HydroSequence;
var fuse:HydroSequence = new HydroSequence();
for (i = 0; i < _headArray.length - 1; i++) {
//HydroTween.go(_headArray[i].container, {alpha:1}, .25, i/4, Quadratic.easeOut);
fuse.addItem({target:_headArray[i].container, alpha:1, duration:.15, easing:Quadratic.easeOut});
}
fuse.addItem({target:_logo, alpha:1, duration:1, easing:Quadratic.easeOut});
fuse.addItem({target:_headArray[_headArray.length - 1].container, delay:1, alpha:1, duration:.1, easing:Quadratic.easeOut});
fuse.addItem({func: triggerAudio});
fuse.addItem({func: _scope.addEventListener, args:[Event.ENTER_FRAME, renderHeads]});
fuse.addItem({func: drawNav});
fuse.start();
HydroSequence internally generates instances of HydroTween to a sequence. All of the functionality of SequenceCA is accessble through HydroSequence now.
If you are interested in testing out/playing with the new version of HydroTween and HydroSequence, contact me offlist and I'll send you the latest. So far it's working great, but wanted to make sure it gets a decent testing before formally posting the updates. Otherwise I should be releasing this soon.
Moses, forgive me for naming all my sequences "fuse". :) Habit I picked up from using Fuse AS2 and I copied and pasted this from the new scaretactics site.
http://www.scifi.com/scaretactics/
*******
Are there any plans to allow HydroTween's sequencing to allow for direct method calls instead of callbacks? Something like:
var seq1:SequenceCA = HydroTween.sequence(
,{target:my_mc, x:0, y:0, alpha:1, duration:3, easing:Sine.easeInOut}
,{scope:this, func:"myFunction", args["hi"]}
}
I've been on an Flash hiatus, and must say I'm impressed with how far HydroTween's come :)
________________________________
_______________________________________________
GoList mailing list
GoList at goasap.org
http://goasap.org/mailman/listinfo/golist_goasap.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://goasap.org/pipermail/golist_goasap.org/attachments/20080702/8b1b043d/attachment-0001.html
More information about the GoList
mailing list