Drag and drop code (for a puzzle) [Flash][Actionscript]

Started by: Plague | Replies: 8 | Views: 2,417

Plague

Posts: 415
Joined: Feb 2007
Rep: 10

View Profile
May 14, 2007 4:34 AM #32721
Well, here is an ActionScript snippet for dragging and droping thing's,

onClipEvent (mouseDown) {
//hittest for collision with mousedown
//_xmouse and _ymouse to follow your cursor
//true for determining whether to do it or not
if (this.hitTest(_root._xmouse,_root._ymouse,
true)) {
startDrag(this);
}
}

onClipEvent (mouseUp) {
//for when you release it saying to not follow the cursor
stopDrag();
}
//also works in earlier version's of flash.
ninjapanda

Posts: 0
Joined: May 2026
May 21, 2007 12:36 AM #33438
cool. Thx for the tut man! I've been wondering how to do that for a while! :)
Saline
2

Posts: 653
Joined: Dec 2006
Rep: 10

View Profile
May 21, 2007 1:06 AM #33442
Give a man a fish, he eats for a day. Teach a man a fish, he eats for a week. It's obvious you copied and pasted this code here.
Plague

Posts: 415
Joined: Feb 2007
Rep: 10

View Profile
May 21, 2007 1:27 AM #33443
Quote from '.:[DA
:.;840304']Give a man a fish, he eats for a day. Teach a man a fish, he eats for a week. It's obvious you copied and pasted this code here.


What the hell is wrong with you! Just because it works and looks like other codes doesn't mean it's C&P, it's just the right way to do it!
koose14

Posts: 0
Joined: May 2026
May 21, 2007 1:37 AM #33444
Hey, .:[DA]:., isnt it give a man a fish he eats for a day, teach a man to fish he eats for his life?
Apples
2

Posts: 1,931
Joined: Dec 2005
Rep: 10

View Profile
May 21, 2007 1:58 AM #33447
Its simple actionscript.
And this type of "tutorial" has been made thousands of times.
Seriously, explain about the code instead of just pasting it.
Plague

Posts: 415
Joined: Feb 2007
Rep: 10

View Profile
May 21, 2007 2:36 AM #33451
Quote from apples
Its simple actionscript.
And this type of "tutorial" has been made thousands of times.
Seriously, explain about the code instead of just pasting it.


Kk, I will explain more.
Plague

Posts: 415
Joined: Feb 2007
Rep: 10

View Profile
May 21, 2007 2:41 AM #33452
Quote from ninjapanda
cool. Thx for the tut man! I've been wondering how to do that for a while! :)

Sorry for the double post, btw, your welcome.
Freddeh
2

Posts: 524
Joined: Nov 2006
Rep: 10

View Profile
May 23, 2007 6:09 PM #33680
Copy & Pasted.