I have an event dispatcher in an irrelevant part of the fla and it works great, but when I go to set it up in this part of the fla it doesn't work. In the irrelevant part it dispatches from an MC to the main timeline which has a listener on it in the first frame then it does it's thing.
maintimeline with listener -> MC with dispatcher
In this part I have the dispatcher dispatching an event from inside an MC to a nested MC.
maintimeline -> MC with dispatcher -> MC with listener
Dispatcher:
ActionScript Code:
stop();
import flash.events.EventDispatcher;
import flash.events.Event;
inperformanceBtn.addEventListener(MouseEvent.CLICK,inperf);
function inperf(evt:MouseEvent):void {
dispatchEvent(new Event("inperfplay", true));
trace("perf clicked");
}
pieBtn.addEventListener(MouseEvent.CLICK,inpie);
function inpie(evt:MouseEvent):void {
dispatchEvent(new Event("inpie", true));
trace("pie clicked");
}
Listener:
ActionScript Code:
stop();
addEventListener("closebtn", closebtn);
addEventListener("inperfplay", inperfPlay);
addEventListener("inpie", inpie);// listen for the custom event dispatched by button
function inperfPlay(e:Event):void
{
trace("perf rec");
popupMC.gotoAndStop(1);
gotoAndPlay("popIn");
}
function inpie(e:Event):void
{
popupMC.gotoAndStop(1);
gotoAndPlay("popIn");
}
function closebtn(e:Event):void
{
gotoAndPlay("popOut");
}
It's setup pretty much the exact same way as the other one. I'm lost.