|
-
Hi all,
I have a simple draggable movie clip. What I want to do is only allow the movie clip to be dragged into a certain area on the stage, and if it is not dragged into that area then it snaps back to its original position.
Can anyone help with this? I am a beginner so please try and explain it well! Thanks so much!
TOm
-
try this...
on (press) {
startDrag ("/drag", false, 105, 230, 430, 230);
}
on (release) {
if (getProperty("/drag", _droptarget) eq "/drop") {
tellTarget ("/feedback") {
gotoAndStop ("correct");
}
} else {
setProperty ("/drag", _x, 113);
setProperty ("/drag", _y, 230);
tellTarget ("/feedback") {
gotoAndStop ("incorrect");
}
}
stopDrag ();
}
**The top part constrains to an axis. the bottom after else tells the MC to spring back if not dropped in the correct place.
-
if you need more explaination, let me know.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|