Find events ?
June 29, 2009 09:27PM
Hello,

I try to find events, I have clip with Show and Hide transition, and I want know how to assign events

I use this:

import com.jumpeye.flashEff.text.alpha.FETAlpha;
import com.jumpeye.Events.FLASHEFFEvents;

test5_mc.myeffect.addEventListener(FLASHEFFEvents.TRANSITION_START, transitionStartHandler);
test5_mc.myeffect.addEventListener(FLASHEFFEvents.TRANSITION_END, transitionEndHandler);

function transitionStartHandler(evtObj:FLASHEFFEvents):void {
     trace("The transition has started.");
}

function transitionEndHandler(evtObj:FLASHEFFEvents):void {
     trace("The transition has ended.");
}

result:

The transition has started.
The transition has ended.
The transition has started.
The transition has ended.


This work fine but how to apply to show and hide separatly ?
Where is "show" and where is "hide", because I want put differents actions to us

Sorry for my poor english
Re: Find events ?
June 30, 2009 07:32AM
Hi,

Your English is great, don't worry.
Regarding your question, here is an example. What it does, is that it only shows the 'transition started' only for the show animation and transition ended only for the hide animation.

import com.jumpeye.Events.FLASHEFFEvents;

myeffect.addEventListener(FLASHEFFEvents.TRANSITION_START, transitionStartHandler);
myeffect.addEventListener(FLASHEFFEvents.TRANSITION_END, transitionEndHandler);

function transitionStartHandler(evtObj:FLASHEFFEvents):void {
if(myeffect.currentTransitionType == "show")
trace("The transition has started.");
}

function transitionEndHandler(evtObj:FLASHEFFEvents):void {
if(myeffect.currentTransitionType == "hide")
trace("The transition has ended.");
}

currentTransitionType is a property of the component, it can provide information about the current animation that is applied.
Note, many users use this property on the target of the component, which will result in an error, so keep that in mind.

Hope it helps,

Ionut.
Sorry, you do not have permission to post/reply in this forum.