A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Mousedown on stage? Clicked movieclip name?

  1. #1
    Senior Member
    Join Date
    Jul 2004
    Posts
    264

    Mousedown on stage? Clicked movieclip name?

    Hi guys,

    using this code...

    Actionscript Code:
    this.onMouseDown = function() {
        // Mouse down anywhere
    }

    What do i put in that function to get the instance name -- if the user clicked, a button, or a movieclip.

    Thankyou!

  2. #2
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Let me see if I get it...you want that when the user click a button, or a movieclip, it shows in a dynamic textbox, or in the output panel that "YOU HAVE CLICKED THE BUTTON Button_A" or "YOU HAVE CLICKED THE MOVIECLIP MC_A" ?? Is that what you want?

  3. #3
    Senior Member
    Join Date
    Jul 2004
    Posts
    264
    no - sorry! That's not what i'm trying to do. I didnt explain it very well

    In AS3 - i could do this...

    Actionscript Code:
    stage.addEventListener(MouseEvent.CLICK, onClick);

    function onClick (event:MouseEvent):void {
        trace("I CLICKED ON: " + event.target.name)
    }


    I'm just looking for the AS2 equivalent

    Thanks for the reply!

  4. #4
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Now I see with clarity hehe. Let me try to help you

  5. #5
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center