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 6702597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:04:20+00:00 2026-05-26T07:04:20+00:00

This has been bugging me for days, cant seem to get an answer after

  • 0

This has been bugging me for days, cant seem to get an answer after googling forever…

Problem is simple,

I have a rectangle with an event listener like so:

rect.addEventListener(MouseEvent.MOUSE_DOWN, startMove);

private function startMove(event:MouseEvent):void
{
    this.nativeWindow.startMove();
}

this works fine.

I also have a button inside this rectangle, and when I click the button the window drags just like if I had clicked on the rectangle.

How can I stop this from happening? I tried removing the event but that didn’t work, I don’t even know which event to remove, the mouseDown or NativeDrag event… There is no stopDrag() function in nativeWindow. Is there a simple solution?

Any help highly appreciated!

  • 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-26T07:04:21+00:00Added an answer on May 26, 2026 at 7:04 am

    You need to only process the event if the event’s target (where it originated from) is the dispatcher you were listening to. The dispatcher is identified via event.currentTarget. So this is what your code needs to look like:

    rect.addEventListener(MouseEvent.MOUSE_DOWN, startMove);
    
    private function startMove(event:MouseEvent):void
    {
       if (event.target == event.currentTarget)
          this.nativeWindow.startMove();
    }
    

    P.S. I notice you’re new to Stack Overflow – welcome! If you find my answer useful, please be sure to upvote it and accept it via the green checkmark

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

Sidebar

Related Questions

This has been bugging me for 2 days now and I cant get my
This problem has been bugging me since forever. I have an array and in
This problem has been bugging me for a while. I have to load a
This one has been bugging me for a while and I cant seem to
This has been bugging me for more than two days now, so i thought
This Jquery problem has been bugging me for a while now. I developed a
This has been bugging me for a couple days now. A list has content
This has been bugging me for a couple days. I'm trying to load a
This issue has been bugging me for the past several days. I've been working
This one has been bugging me for a while now, but I never seem

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.