aeFadeOutDone Callbackmessage Use

Create fast, sprite powered games with Animation Engine, co-developed with DerBrill Software!

Moderators: heatherlaine, kevinmiller, robinmiller, malte

Post Reply
gshearne
Posts: 24
Joined: Mon Jun 02, 2014 4:41 am

aeFadeOutDone Callbackmessage Use

Post by gshearne » Sun Mar 12, 2017 12:25 am

Malte (or any other kind soul),

I am having a problem getting the below snippet to work. I keep getting a compile error. I am on build 8.13. I just want to wait till my image fade out is done before moving to a new card.

aeFadeOut the long ID of img "Picture", 2000
on aeFadeOutDone
go to card "Next Topic"
end aeFadeOutDone

I have tried a variety of things but none successful. Any guidance would be appreciated.
Thaks
Greg

qberty
Posts: 14
Joined: Thu Dec 16, 2010 8:08 pm

Re: aeFadeOutDone Callbackmessage Use

Post by qberty » Tue Mar 14, 2017 6:01 pm

A safer way to do this is without locking any messages. Try the send in time function:

Code: Select all

on mouseUp
aeFadeOut the long id of img "Picture",2000
send "FadedOut" to me in 2025 millisecs
end mouseUp

on FadedOut
go to card "Next Topic"
end FadedOut
The important thing to note here when using animationEngine and sending in time functions is that there needs to be some variance with the sending milliseconds (hence the 2025 instead of just 2000), so you don't cause conflicts just in case.

Klaus
Posts: 9619
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: aeFadeOutDone Callbackmessage Use

Post by Klaus » Wed Mar 15, 2017 12:41 pm

Hi Greg,

Code: Select all

   aeFadeOut the long ID of img "Picture", 2000
   on aeFadeOutDone
       go to card "Next Topic"
   end aeFadeOutDone
if this is your code then a compile error isn't a surpise really! 8)

The "aeFadeOut" command should of course be wrapped in some kind of handler like "mouseup"!
I do not use AE but I guess the "aeFadeOutDone" will be sent to the object that invoked the "aeFadeOut" command.

In that case you should script:

Code: Select all

on mouseup
   ## or opencard or whenever you want to fire this one!
   aeFadeOut the long ID of img "Picture", 2000
end mouseup

## This needs to be in the same script or at least somewhere in the correct message hierarchy!
on aeFadeOutDone
    go to card "Next Topic"
end aeFadeOutDone
Best

Klaus

gshearne
Posts: 24
Joined: Mon Jun 02, 2014 4:41 am

Re: aeFadeOutDone Callbackmessage Use

Post by gshearne » Sun Mar 19, 2017 12:23 pm

Thank you very much for both suggestions. At first neither worked for me in my stack but when I did a new stack it was fine. I think I have done to much experimenting in the first stack and have managed to corrupt something. Thanks again.

Post Reply

Return to “Animation Engine”