Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5843493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:09:44+00:00 2026-05-22T12:09:44+00:00

How can i check if a click was on the stage (not on a

  • 0

How can i check if a click was on the stage (not on a other object in front of the stage – just on a place where no other object is) or on a movieclip (name “mcSlideHolder”)?

function onMouse_Down(e:MouseEvent):void
{
    trace("MouseDown occured");
    trace("MouseDown target: " + e.target.name);
    trace("MouseDown target.tostring: " + e.target.toString);
    trace("MouseDown currentTarget: " + e.currentTarget);
    if(e.target.name == null || e.target.name == "mcSlideHolder")
    {   
        this._userInput();
    }
}

My Problem is, that e.target.name is null, when clicking on the stage.
When clicking on the mcSlideHolder e.target.name is “instance235”.
How would you do this?

Thanks for any advice!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:09:45+00:00Added an answer on May 22, 2026 at 12:09 pm

    Normally, when you want to detect a click on a specific MovieClip, that is the one you add the listener to:

    mcSlideHolder.addEventListener(MouseEvent.MOUSE_DOWN, onSlideHolderMouseDown);
    

    rather than

    stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
    

    It sounds like you’re doing the latter; adding a listener to the stage, and trying to figure out in the listener function what was clicked on. There is nothing wrong with this, and it can even be efficient if there are many possible things to click on. But in this case, the currentTarget is always going to be the stage, and the target is always going to be the thing you clicked on that generated the event. If that is indeed how you have things set up, you will get a different result–possibly the one you expected–if you do this:

    mcSlideHolder.mouseChildren = false;
    

    I’m assuming mcSlideHolder is the instance name. Setting mouseChildren to false will mean that mcSlideHolder will generate the MOUSE_DOWN event rather than instance235 that is its child.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I click in a image/function with javascript? Something like: document.getElementById(check-in-banner).click(); the source
Just wondering is there any way I can check whether the url links to
My app needs to check whether user double clicks or not. But I can't
DataGridView.CellContentClick is not firing if I mouse click a DataGridViewCheckBoxCell very fast. How can
How can I change the bitmap check_box1 by another check_box2 on click the bitmap
Can check out here alt text http://51hired.com/static/problem.bmp
I can check for iPhone with this code: (navigator.userAgent.match(/iPhone/i)) But I want to target
How I can check the date using a calender , what I want to
With this code I can check the caret position in a textarea in firefox:
I know that I can check whether the linux timestamp in $time is today

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.