2 Replies Latest reply on Apr 24, 2011 2:37 PM by scigonsolutions

    Detecting Click on an MC inside an attached movieclip

    scigonsolutions

      I'm working with a MovieClip ("mainMenuItem") that is linked to a Class ("GenericMenuItem.as") that uses attachMovie to add another movieclip ("Arrow") to mainMenuItem as follows:

       

      mcArrow = this.attachMovie(prefix+"Arrow", "_Arrow_symbol", this.getNextHighestDepth());

       

      I'm able to use on(release) within the Class definition to capture clicks on the mainMenuItem component, but haven't been able to find a way to detect a click on the "Arrow" library item that gets attached to that component.

       

      Any thoughts?

        • 1. Re: Detecting Click on an MC inside an attached movieclip
          Ned Murphy Adobe Community Professional & MVP

          If you have an on(release) assigned to the mainMenuItem, that will block interaction with anything you place inside of it.

          • 2. Re: Detecting Click on an MC inside an attached movieclip
            scigonsolutions Level 1

            Thanks...GenericMenuItem (the class linked to mainMenuItem, which itself doesn't have any code) doesn't have any on(release) actions inside it now. I've tried creating a separate Arrow.as class and linking it to that Arrow MovieClip symbol. I'm able to trace output inside the constructor for the Arrow class, but haven't had any luck creating an onPress/onRelease function that works there (I've tried a "this.onPress = Delegate.create(this,function()..." in the constructor, and a "public function onRelease()" in the class body without any luck in either case. I also tried adding "mcArrow.onRelease = function()" below instantiation for mcArrow in the GenericMenuItem.as class, where this is attached (ensuring that the onRelease action occurs in either the Arrow.as class or the GenericMenuItem.as, but not in both places simultaneously, to avoid conflicts). In all cases, I haven't been able to trace anything out on a click action, so don't believe it is handling clicks for this.

             

            I'd be happy to send over project files if you'd like to take a look. Getting some pressure from a client to get this working, so any help you can provide would be immensely appreciated.

             

            Any thoughts?