ActionScript 3.0 Lesson 13: Flash Drag and Drop

Wed, Aug 12, 2009

ActionScript

This movie requires Flash Player 9


CLICK HERE FOR A LIVE DEMONSTRATION OF THE TUTORIAL

On this tutorial we show how to start the drag through an event listener. The event listener will fire a function that starts the drag, stops the listener for mouse down and starts waiting for release.

DOWNLOAD THE SOURCE FILE HERE

DOWNLOAD THE TUTORIAL TO YOUR HARD DRIVE


Here is the Code!!
// Circle Flash Drag and Drop
// by Avraham Saltoun solutions at say-web dot com
// FREE to use, copy and Distribute.

//It all starts with an Event Listener

Circle_mc.addEventListener(MouseEvent.MOUSE_DOWN, Drag);

/*

The _mc enables CODE HINTING for Movie Clip
(The drop down with suggestions)

When the mouse button is clicked the compiler
will look and go for the Drag function */

function Drag (e:MouseEvent): void {

// The e represents the value beign recieved
// void is good practice to state no value
// will be return. Would work without it!

Circle_mc.startDrag();
Circle_mc.removeEventListener(MouseEvent.MOUSE_DOWN,Drag);
Circle_mc.addEventListener(MouseEvent.MOUSE_UP, Drop);

}

function Drop (e:MouseEvent):void

// Let’s copy and paste
// This will release the circle
// from the mouse!

{
Circle_mc.stopDrag();
Circle_mc.removeEventListener(MouseEvent.MOUSE_UP,Drop);
Circle_mc.addEventListener(MouseEvent.MOUSE_DOWN, Drag); }

// Thanks for Watching !!!!

Related Articles:

, , , , , , , , , , , , , , ,

70 Responses to “ActionScript 3.0 Lesson 13: Flash Drag and Drop”


Trackbacks/Pingbacks

  1. Tumblr article…

    I saw a writer writing about this on Tumblr and it linked to…

  2. …For further Information click here…

    [...]Excellent blog here! Also your site so much up fast![...]…

  3. ab346368@gmail.com

    A friend told me I needed to read this article, so here I am. I found this to be interesting and well-written. It’s very good….

  4. pool fence says:

    ab346368@gmail.com

    Your article has inspired me. It’s interesting, thoughtful, compelling and well-written. You are a very talented writer with great skills and original thoughts. Your viewpoints match mine in many ways….

  5. ab346368@gmail.com

    This topic usually doesn’t interest me, but you have managed to write this article in a unique manner. It’s not boring and I read the whole thing without stopping once….

  6. Intivar says:

    click to know…

    Intivar Review…

  7. ab346368@gmail.com

    I’m honestly impressed by the information you have used in your article. I just happened to find your article and I’m glad. Your points are valid and the information is easy to read and understand….

  8. ab346368@gmail.com

    Thank you for submitting this article. This is information I have been looking for. I’ve been hoping to find clear and concise content like yours. Your unique points helped me think about this information differently….

  9. ab346368@gmail.com

    I agree with a lot of the points you bring up in this article. Your passion for this subject and the way you describe it is very interesting. Great job….

  10. ab346368@gmail.com

    Great stuff, would love further information about this though…

  11. yahoodsl says:

    …Visitor recommendations…

    [...]Very efficiently written information. It is going to be priceless to anyone who usess it, including myself. Keep up the good work � for sure i will check out more posts.[...]…

  12. ab346368@gmail.com

    When I started reading your article, I figured this would be the same old boring content I had been reading. I was completely wrong. Your article made this topic more clear in an interesting way….

  13. ab346368@gmail.com

    I have been reading a lot on this topic lately, but your info is great. You have written your article in a most unique manner….

  14. here says:

    ab346368@gmail.com

    It’s not uncommon for an article with this much information to become confusing, but your content is clear. I can relate to many of the points contained in this material….

  15. ab346368@gmail.com

    I think you did an awesome job explaining it. Sure beats having to research it on my own. Thanks…

  16. ab346368@gmail.com

    Your articles are always of great quality, and I thoroughly enjoyed this one particularly. I do hope you continue to create more writings. Thank you!…

  17. ab346368@gmail.com

    {Beautiful and Unique Oak Furniture hand built from solid Oak Wood….

  18. tatuaggi says:

    Title…

    Rats that was weird. I just wrote an extremely detailed response but after I clicked submit my comment didn’t show up. Sigh well I’m not writing all that again. Anyways, just wanted to say cool blog!…

  19. SEO Perth says:

    Title…

    Wow, I’m so happy that I landed on this site, great info here! Better than http://facebook.com!…

  20. SEO Company says:

    Title…

    Ugh, I just typed a huge comment, but it disappeared when I hit send. Anyway, I’m not going to redo it again, so I just wanted to say nice blog! Better than http://facebook.com! :-)

Leave a Reply

You must be logged in to post a comment.

My name is Avraham Saltoun, and I live in Jerusalem, Middle East. I am currently on my mid  40's and I am a computer programming technician. Here you will find over one hundred quality video tutorials on Actionscript, and yes, I give online support for aspiring programmers, and pros as well, sharing screen on skype and delivering source code by email, click the button for live flash actionscript support now!

 
oDesk Certified Action Script Programmer
oDesk Certified Adobe Flash CS3 Designer
oDesk Certified Adobe Photoshop 6.0 Designer
Skype Me™!

$7.49 .Com! Score Savings Cartoon Smart Tutorials


839
Unique Visitors
Previous 30 Days
Powered By Google Analytics