6 Replies Latest reply on Aug 22, 2007 12:33 AM by kumzlee

    detect a movieClip name on mouseOver

    kumzlee
      Hi Dudes,

      I want to find out(detect) a movieClip's name on mouseOver. plese help me.

      I tried with hitTest and mouse listener but not able to get the movieclip's name on its mouseover state.

      thanks in advance.

      Regads,
      kumanan
        • 1. Re: detect a movieClip name on mouseOver
          BarryGee Level 1
          kumzlee.

          What are you trying to do to the movieClip once you have found its name? I had a similar problem i was duplicating a MC and needed to delete all of the duplicate MCs at the press of a button, The problem i had was finding the names of all of the newly created MCs. What i did instead was to create and array, each time the movie clip was duplicated i added the name to the array, when i needed to delete all of the duplicates i set an action to scroll through the array deleting MCs with the same names as those stored in the array.

          Barry.
          • 2. detect a movieClip name on mouseOver
            _name
            hope this is of some help:
            • 3. Re: detect a movieClip name on mouseOver
              kumzlee Level 1
              Hi Buddies...

              Thanks for ur quick replies. But actualy this was not i needed.

              I know all the MovieClip names but I dont want to write the onRollOver event listener insted I want to find out the MovieClips name using the "hittest" or any other method on onEnterFrame.

              Regards,
              ****
              • 4. detect a movieClip name on mouseOver
                _name Level 1
                do not understand what you are talking about or what you want to do.
                the code above does not write out the onRollOver event listener; it traces out the _name property of your_mc to the output window and also inserts the _name property of your_mc into a text field. below you will find a snippet of code that uses both onEnterFrame and hittest to retrieve the _name property of your_mc.

                instructions:

                1.) make sure that the uppermost layer of your root is labeled "actions," and that it contains no mc's, buttons, or any other objects.

                2.) make certain that your_mc is on the root and also not on the "actions" layer.

                3.) place the code i sent you below into the "actions" layer on the same FRAME that your_mc resides in.
                • 5. Re: detect a movieClip name on mouseOver
                  DazFaz Level 1
                  this.onMouseMove = function() {
                  for (var i in _root) {
                  if (eval(i).hitTest(_root._xmouse, _root._ymouse, true)) {
                  trace(i+"|| Has been rolled over");
                  }
                  }
                  };
                  • 6. Re: detect a movieClip name on mouseOver
                    kumzlee Level 1
                    Yup, this will may work-out... nice idea!! thx dude...