any ideas about my addEventListener problem?
Hi, I have what I think is a very unusual problem with the addEventListener. I have used it successfully on a few projects, so I am not that new to this function. When I run test movie it works perfectly (even buttonMode works), but when I run test movie on the parent movie it does NOT work. BTW, the addEventListener in question is a sub movie to the main movie. What is odd is that other eventListeners in this sub movie are working.
below is the code that is in the sub movie timeline.. the movie "mytestbtn" is not even getting the buttonMode=true. The mytestbtn is in a layer of that movie. I tried mytestbtn.visible=false, and sure enough it was not visible. I really don't believe it is this code, I think there might be something else going wrong because as I said, simply testing this movie it works fine.. only when it is loaded into the main movie does it stop working.
mytestbtn.buttonMode=true;
mytestbtn.addEventListener(MouseEvent.CLICK, tryagainx);
function tryagainx(evt:MouseEvent):void {
gotoAndPlay(1);
}
mytestbtn.addEventListener(MouseEvent.ROLL_OVER, rolloverx);
function rolloverx(evt:MouseEvent):void {
trace("i got rolled over");
mytestbtn.gotoAndStop(2);
}
mytestbtn.addEventListener(MouseEvent.ROLL_OUT, rolloutx);
function rolloutx(evt:MouseEvent):void {
mytestbtn.gotoAndStop(1);
}
Maybe my question would be better asked if there is something that can cause an eventlistener to stop working, besides the obvious, ie removal of the eventlistener.
Thanks for any help with this one..
Jim