Log in

View Full Version : Listeners for nested MCs whose parent has a listener?



jlizarraga
09-17-2008, 09:10 PM
Hi all,

I use the following AS2 to play/rewind MCs as your mouse moves over or off the MC:


function someFunction(obj) {
if (obj.hitTest(_root._xmouse, _root._ymouse, true) && obj._currentframe<obj._totalframes) {
obj.nextFrame();
}
if (!obj.hitTest(_root._xmouse, _root._ymouse, true) && obj._currentframe>1) {
obj.prevFrame();
}
}

I assign this function to MCs with the following:


_root.someMC.onEnterFrame = function () {
someFunction(this);
}

This causes any listeners for nested MCs within someMC to stop working.

Does anyone know how to get around this? Thanks for any responses!

Medyman
09-18-2008, 10:46 PM
Flash doesn't support nested mouse events. If you want to access mouse events on an object within an object, you'll have to delete the mouse event on the parent.