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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:25:01+00:00 2026-05-31T12:25:01+00:00

In writing an ActionScript 3 program, I am trying to make it so that

  • 0

In writing an ActionScript 3 program, I am trying to make it so that I can drag an object from one location to another after doing some other stuff. The trouble is, I can drag just fine, but apparently I can’t stop dragging, even with a listener to make it stop. I can’t figure out any reason why this is happening. The relevant part of my code is as follows:

public function setToDragAndDrop(){
    this.graphic.removeEventListener(MouseEvent.CLICK, rotate);
    this.graphic.addEventListener(MouseEvent.MOUSE_DOWN, drag);
    this.graphic.addEventListener(MouseEvent.MOUSE_UP, endDrag);
}

private function drag(e:MouseEvent):void{
    trace("Dragging...");
    this.graphic.startDrag(true);
    trace(this.graphic.hasEventListener(MouseEvent.MOUSE_UP)); //Returns true
}

private function endDrag(e:MouseEvent):void{
    trace("Stopped dragging.");
    this.graphic.stopDrag();
}

I do not get the “Stopped dragging” line in my output, so the endDrag MouseEvent is never getting called, even though it exists (as the trace proves). So instead whether the mouse is up or down, it continues to drag. I’ve found that if I click on another draggable object, that one starts dragging instead.

I’m baffled. Any help would be greatly 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-31T12:25:03+00:00Added an answer on May 31, 2026 at 12:25 pm

    I figured out the problem. Apparently when you create the shape, it’s “drag point” is at (0,0), or if you premake the shape in Flash, the upper left corner of the “rectangle” that surrounds the figure. When you click on the shape, your mouse jumps to this “drag point.”

    Apparently, if the drag point does not actually lie on the body of the shape, drag and drop doesn’t work. So the ovals I was using earlier didn’t work because the drag point was off the shape. Your example did work because it was created at (0,0) and your drag point was at (0,0). But if you draw a circle that isn’t at (0,0), like drawCircle(200,200,100) (i.e. draw a circle at point (200,200) with a radius of 100), then you encounter the problem that I have because the drag point is not on the shape.

    The solution then is to create the circle at 0,0, then move it to the position you want. It’s strange, but I finally got it to work.

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

Sidebar

Related Questions

We are writing an app that will use T4 to generate Flex/Actionscript to compile
I'm aware that ActionScript 3.0 is designed from the ground up to be a
I'm trying to improve my code by writing unit tests for my ActionScript 3
For a program i'm writing I need to marshal ActionScript classes to a format
I'm currently writing a client in ActionScript 3 that talks to a Red5 application/media
Is there a practical "crash" guide for writing ActionScript 3. There's migration books from
I am writing a bit of actionscript that loads an xml file and displays
Writing text to .txt files using actionscript. how? i couldn't find anything about that
I'm writing my own documentation for a small ActionScript 3 library that I've written.
I am writing a game in ActionScript where I've got multiple classes that should

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.