PDA

View Full Version : Animator problems



zquirm
2 Dec 2006, 11:26 PM
first off...animator is amazing!

but I'm having a problem, and I know I'm doing something stupid...but I thought I'd ask rather than spend hours working on it, fun as that may be.

I find that after I've run animator, the function that I've called with addCall during the sequence from that point on also runs the animator sequence again...and the more I run it, the more animator sequences run. Obviously it's getting attached to the event that fires the function, but I'm not sure how.

Here's my code:

var animator = new YAHOO.ext.Animator();
var cursor = new YAHOO.ext.Actor('cursor-img', animator);

animator.startCapture();
cursor.alignTo('friend_strip_green', 'tl', [15, 10],true);
animator.addCall(Example.expand,null,this);
animator.pause(.5);

cursor.moveTo(-100, -100, true);

animator.stopCapture();
animator.play();


so, in this case, after the animation has played, every time time Example.expand runs, the animation plays again.

thoughts?

jack.slocum
3 Dec 2006, 5:56 AM
There's nothing in the code that would overwrite the function. One thing I did notice, is your scope for the call appears to be off.

animator.addCall(Example.expand,null,this);

Since the method is attached to Example, it's scope should be Example?

animator.addCall(Example.expand,null,Example);

If don't think that would cause what you have described but...

zquirm
3 Dec 2006, 11:45 AM
got it figured out. I was adding several sequences to the same animator...so I just made a few private ones. works great.

I was wondering if you still had that "click" graphic on your server somewhere.

jack.slocum
3 Dec 2006, 11:52 AM
It's in the same spot I am pretty sure. I'll put in a link and we will see!

http://www.jackslocum.com/blog/images/click.gif

jack.slocum
3 Dec 2006, 11:53 AM
Yep :)

zquirm
3 Dec 2006, 12:15 PM
thanks!