I'm new to Animation engine and I am using it to have 5th grade students who have good musical rhythm and keyboarding skills make animated candles dance above a Hanukkah Menorah for a holiday program. Using 8 keydown handlers to call the aeMoveTo command to make the 8 buttons (candle icon) jump up and then having the aeMoveDone callback handler in each candle's script to bring them done with a satisfying bounce, I have created a wonderful dance format to have the candles leaping in sync with live music on any key combination the would make clever sequential group movements.
My problem is that when I go the next card for a different scene and type of animation, I get error windows popping up applying to the buttons that have the on aemoveDone scripts in them. I am assuming that this is because their is nothing clearing a second aeMoveDone callback made after the buttons execute their internal aeMoveTo scripts to fall back donw to their starting positions:
on aeMoveDone
aeMoveTo the long ID of button "candle1",373,217, 500,"bounce"
end aeMoveDone
Even though the key strokes execute everything beautifully, it is the script windows of the animated buttons that open up with the following error when I "go next":
Chunk: no such object
Object candle1
Line aeMoveTo the long ID of button "candle1",373,217, 500,"bounce"
Hint candle1
I assume the next card is calling for the object.
How do I clear out the callbacks or whatever is firing up the error windows when I go to the next card?
trouble with aeMoveTo & aeMoveDone
Moderators: heatherlaine, kevinmiller, robinmiller, malte
Re: trouble with aeMoveTo & aeMoveDone
Hi,
what happens here is that you end up in a neverending loop of aeMoveDone calls, sent every 500 milliseconds. You can fix that with a condition check.
[edit: adding a there is condition check too to make it saver]
Also, if you want to leave the card, you can call
aeStopMoving "all"
to stop all movement that is currently executed. I think I forgot to document that call. Sorry about that. It would also take the long ID of a moving control as a parameter to stop that.
Hope that helps,
Malte
what happens here is that you end up in a neverending loop of aeMoveDone calls, sent every 500 milliseconds. You can fix that with a condition check.
[edit: adding a there is condition check too to make it saver]
Code: Select all
on aeMoveDone
if there is a button "candle1" then
if the loc of button "candle1" <> 373,217 then
aeMoveTo the long ID of button "candle1",373,217, 500,"bounce"
end if
end if
end aeMoveDone
aeStopMoving "all"
to stop all movement that is currently executed. I think I forgot to document that call. Sorry about that. It would also take the long ID of a moving control as a parameter to stop that.
Hope that helps,
Malte
Re: trouble with aeMoveTo & aeMoveDone
Thanks so much Malte. The aeStopMoving "all" handler is a godsend.
rudyrev