Results 1 to 2 of 2

Thread: Listeners for nested MCs whose parent has a listener?

  1. #1
    Join Date
    Apr 2008
    Location
    San Diego, CA
    Posts
    352
    Thanks
    57
    Thanked 6 Times in 6 Posts

    Default Listeners for nested MCs whose parent has a listener?

    Hi all,

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

    Code:
    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:

    Code:
    _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!

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •