[Golist] HydroSequence Looping Issue

Bernardo Kuri support at bernardokuri.com
Thu Feb 12 15:11:22 PST 2009


Here's the thing: I'm creating a banner rotator, which basically does the
following:

   1. reads an XML file
   2. creates banner(s) on the fly based on the XML parameters
   3. adds the banner(s) to a queue
   4. the sequence rotates the item(s) on the queue indefinitely

So I'm not really reusing a sequence; rather I initialize the sequence
object on my init() function, and then call my addBanner() function, which
adds the addStep() parameters to said sequencer object. I then call
__sequence.start() once all the banners have been parsed/added to the queue.

Does this clear it up a bit?

Bernardo Kuri


On Thu, Feb 12, 2009 at 4:55 PM, Donovan Adams <donovan at hydrotik.com> wrote:

> Can you create a new instance of the HydroSequence?
>
> Is their a reason you are reusing the same one?
>
> Might be better at this point to create a new instance of the sequence as
> well as populate the props and values and functions?
>
> -------- Original Message --------
> > From: "Bernardo Kuri" <support at bernardokuri.com>
> > Sent: Thursday, February 12, 2009 10:49 AM
> > To: "Mailing list for the Go ActionScript Animation Platform"
> <golist at goasap.org>
> > Subject: Re: [Golist] HydroSequence Looping Issue
> >
> > Here's my new code:
> > __sequence.addStep(new HydroTween(this, { func:functionOne,
> args:[whatever]
> > }, 0, 0, null, null, null, null, null, null, null, false ));
> > __sequence.addStep(new HydroTween(this, { func:functionTwo }, 0, 0,
> null,
> > null, null, null, null, null, null, false ));
> > __sequence.addStep(new HydroTween(__fader, { start_alpha:1, alpha:0,
> > duration:__duration_fade }, 0, 0, null, null, null, null, null, null,
> null,
> > false ));
> > __sequence.addStep(new HydroTween(this, {
> delay:Number(properties. at timeout)
> > || __duration_timeout, func:trace, args:['timeout triggered'] }, 0, 0,
> null,
> > null, null, null, null, null, null, false ));
> >
> > I changed the nulls to point to "this", as well as the "false" in the end
> of
> > each addStep() call, but I got the same results as before. The __fader
> > Sprite did not work before or after the change, BTW.
> > Hope that helps,
> >
> > Bernardo Kuri
> >
> >
> > On Thu, Feb 12, 2009 at 4:36 PM, Donovan Adams <donovan at hydrotik.com>
> wrote:
> >
> > > Possible that since you are adding HydroTween instances with a null
> target
> > > the tweens aren't working properly.
> > >
> > > I'm assuming the __fader is tweening fine though? Make sure you are
> adding
> > > the argument to disable the GC. was in the last snippet I sent. Looks
> like
> > > it got omitted in the code you sent.
> > >
> > > Still trying to figure out what's going on and it looks like a couple
> of
> > > things.
> > >
> > > The optimization of HydroTween for Garbage Collection is creating the
> issue
> > > with HydroSequence when sequences need to be reused. Just needs a
> little
> > > hashing out.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > -------- Original Message --------
> > > > From: "Bernardo Kuri" <support at bernardokuri.com>
> > > > Sent: Thursday, February 12, 2009 10:24 AM
> > > > To: "Mailing list for the Go ActionScript Animation Platform"
> > > <golist at goasap.org>
> > > > Subject: Re: [Golist] HydroSequence Looping Issue
> > > >
> > > > Thanks for the suggestion, Donovan.I had to modify your example to
> fit
> > > my
> > > > code, and this is what i came up with:
> > > >
> > > > // start code
> > > > __sequence = new Sequence();
> > > > __sequence.addEventListener("START", onSeqEvent, false, 0, true);
> > > > __sequence.addEventListener("CYCLE", onSeqEvent, false, 0, true);
> > > > __sequence.repeater.cycles = Repeater.INFINITE;
> > > >
> > > > // The following code resides in another function. As you can see,
> the
> > > > sequence needs to be dynamically created:
> > > >
> > > > __sequence.addStep(new HydroTween(null, { func:functionOne,
> > > args:[whatever]
> > > > } ));
> > > > __sequence.addStep(new HydroTween(null, { func:functionTwo } ));
> > > > __sequence.addStep(new HydroTween(__fader, { start_alpha:1, alpha:0,
> > > > duration:__duration_fade } ));
> > > > __sequence.addStep(new HydroTween(null, {
> > > delay:Number(properties. at timeout)
> > > > || __duration_timeout, func:trace, args:['timeout triggered'] } ));
> > > > __sequence.start();
> > > > // end code
> > > >
> > > > The weird thing is that none of the events are being dispatched at
> all.
> > > On
> > > > top of that, my "timeout triggered" trace is not showing on my
> output
> > > > anymore.
> > > > Is there anything else I can try?
> > > >
> > > > Thanks a bunch,
> > > >
> > > > Bernardo Kuri
> > > >
> > > >
> > > > On Thu, Feb 12, 2009 at 1:45 PM, Donovan Adams
> <donovan at hydrotik.com>
> > > wrote:
> > > >
> > > > > It seems there is an issue with the autoGC feature and passing a
> param
> > > into
> > > > > HydroSequence.
> > > > >
> > > > > The reason it's not repeating is that HydroTween is clearing out
> the
> > > memory
> > > > > of the tweens in a sequence.
> > > > >
> > > > > I will have to delve into this a bit deeper, but in the meantime y
> ou
> > > might
> > > > > consider using this as an option?
> > > > >
> > > > > var ht1:HydroTween  = new HydroTween(target, {x:300}, 1, 0,
> > > > > Quadratic.easeOut, null, null, null, null, null, null, false);
> > > > > var ht2:HydroTween  = new HydroTween(target, {x:100}, 1, 0,
> > > > > Quadratic.easeOut, null, null, null, null, null, null, false);
> > > > >
> > > > > var seq:Sequence = new Sequence(ht1, ht2);
> > > > > seq.repeater.cycles = Repeater.INFINITE;
> > > > > seq.start();
> > > > >
> > > > > -------- Original Message --------
> > > > > > From: "Bernardo Kuri" <support at bernardokuri.com>
> > > > > > Sent: Thursday, February 12, 2009 6:58 AM
> > > > > > To: golist at goasap.org
> > > > > > Subject: [Golist] HydroSequence Looping Issue
> > > > > >
> > > > > > Hello fellow GoList members,
> > > > > > I would really appreciate it if someone can help me out with
> this
> > > issue.
> > > > > My
> > > > > > project will be ready to launch as soon as this is fixed.
> > > > > >
> > > > > > I am having an issue with a HydroSequence instance that I need
> to
> > > loop
> > > > > > indefinitely. As far as I understand it, a HydroSequence class
> > > instance
> > > > > > has a public property called "repeater" that needs to be set to
> > > > > > Repeater.INFINITE in order to accomplish infinite looping. The
> > > problem
> > > > > is
> > > > > > that it's
> > > > > > not actually doing that at all. I tried adding a listener for
> the
> > > > > "CYCLE"
> > > > > > event, but that doesn't get triggered either.
> > > > > >
> > > > > > Here's the relevant portion of the code:
> > > > > >
> > > > > > --------------------------------------
> > > > > >
> > > > > > import com.hydrotik.go.HydroSequence;
> > > > > > import org.goasap.managers.Repeater;
> > > > > >
> > > > > > __sequence = new HydroSequence();
> > > > > > __sequence.repeater.cycles = Repeater.INFINITE;
> > > > > >
> > > > > > __sequence.addItem( { func:firstFunction, args:[whatever] } );
> > > > > > __sequence.addItem( { func:secondFunction } );
> > > > > > __sequence.addItem( { target:__fader, start_alpha:1, alpha:0,
> > > > > > duration:__duration_fade } );
> > > > > > __sequence.addItem( { delay:Number(properties. at timeout) ||
> > > > > > __duration_timeout, func:trace, args:['timeout triggered']} );
> > > > > >
> > > > > > __sequence.start();
> > > > > >
> > > > > > --------------------------------------
> > > > > >
> > > > > > If I execute the above and look at the output, "timeout
> triggered"
> > > will
> > > > > show
> > > > > > only once, which is obviously not what I need.
> > > > > >
> > > > > > I have even tried adding another step to the sequence that
> basically
> > > > > calls
> > > > > > __sequence.start(), like so:
> > > > > >
> > > > > > __sequence.addItem( { taget:__sequence func:start } );
> > > > > >
> > > > > > ... but that did absolutely nothing.
> > > > > >
> > > > > > Am I missing something here? I really can't seem to get it to
> work
> > > > > > correctly.
> > > > > > Thanks for your time guys!
> > > > > >
> > > > > > Bernardo Kuri
> > > > > >
> > > > > > _______________________________________________
> > > > > > GoList mailing list
> > > > > > GoList at goasap.org
> > > > > > http://goasap.org/mailman/listinfo/golist_goasap.org
> > > > >
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > GoList mailing list
> > > > > GoList at goasap.org
> > > > > http://goasap.org/mailman/listinfo/golist_goasap.org
> > > > >
> > > >
> > > > _______________________________________________
> > > > GoList mailing list
> > > > GoList at goasap.org
> > > > http://goasap.org/mailman/listinfo/golist_goasap.org
> > >
> > >
> > >
> > > _______________________________________________
> > > GoList mailing list
> > > GoList at goasap.org
> > > http://goasap.org/mailman/listinfo/golist_goasap.org
> > >
> >
> > _______________________________________________
> > GoList mailing list
> > GoList at goasap.org
> > http://goasap.org/mailman/listinfo/golist_goasap.org
>
>
>
> _______________________________________________
> 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/20090212/5ccc04f0/attachment-0001.html>


More information about the GoList mailing list