I have the following functions:
private function createContent(slideData:Object):void
{
transitions = new Transitions();
if (slide){
transitions.applyTransition(slide);
transitions.addEventListener(Transitions.TRANSITION_COMPLETE, completeHandler);
}
slide = new Slide(slideData);
addChild(slide);
transitions.applyTransition(slide);
}
private function completeHandler(e:Event):void{
removeChild(slide);
}
I dispatch an event in the first function and when it comes to the completehandler i would like to delete the slide from the first function but it isnt recognized. How can i pass the slide with the eventlistener so i can remove it in the completeHandler?(i have several instances from slide so i have to pass it through to have the right instance). Anyone who can help me?