onComplete Listener for Hide?

Posted by urbanlace 
onComplete Listener for Hide?
January 28, 2009 02:03AM
Is there a way to apply a listener to an animation that listens for onComplete, onStart, etc...? For instance: If I apply a sparkle effect for Show, then the same sparkle effect for Hide, but once Hide effect is complete the listener fires off a command.

Hope this question makes sense. Thanks in advance.



Edited 2 time(s). Last edit at 01/28/2009 02:04AM by urbanlace.
Re: onComplete Listener for Hide?
January 28, 2009 11:44AM
Hello

Here is an example on how you can do that using the FLASHEFFEvents.TRANSITION_END:

import com.jumpeye.Events.FLASHEFFEvents;

myEffect.addEventListener(FLASHEFFEvents. TRANSITION_END, transitionEndHandler);

function transitionEndHandler(evtObj: FLASHEFFEvents):void {

if (myEffect.currentTransitionType=="hide" )
{
trace("The "+evtObj.target.currentTransitionType+" transition has ended." );
}
}
Re: onComplete Listener for Hide?
January 28, 2009 06:13PM
Thank you florodebat.

However, I applied the provided code and didn't receive the trace. I attached an example file that I was using to test. If you have a sec to maybe look at it and let me know what I am doing wrong I would appreciate it.

Thanks again.
Re: onComplete Listener for Hide?
January 29, 2009 07:03AM
Hello

Your mistake was that you tried to add an Event Listener to the target of the flashEff . All you should do is to give an instance name to the FashEff instance and than add the Event Listener to it like this:

myFlashEffInstanceName.addEventListener(FLASHEFFEvents. TRANSITION_END, transitionEndHandler);

function transitionEndHandler(evtObj: FLASHEFFEvents):void {

if (myFlashEffInstanceName.currentTransitionType=="hide" )
{
trace("The "+evtObj.target.currentTransitionType+" transition has ended." );
}
}

Next time when you want to post an example please make sure that you do not have premium patterns imported in the library or if your issue is specific to a premium pattern than you can write to the support team (support [at] jumpeyecomponents [dot] com) with a detailed description of your problem and attach your source files to the mail.
Thank you for your inderstanding
Sorry, you do not have permission to post/reply in this forum.