# Drag 'n' drop question

**URL:** <https://forum.kirupa.com/t/drag-n-drop-question/25302>\
**Category:** flash\
**Created:** [July 11, 2003, 9:12am UTC](https://forum.kirupa.com/t/drag-n-drop-question/25302 "2003-07-11T09:12:13Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flash\_monkey](https://avatars.discourse-cdn.com/v4/letter/f/ecc23a/32.png) [@Flash\_monkey](https://forum.kirupa.com/u/Flash_monkey)\
**Post date:** [July 11, 2003, 9:12am UTC](https://forum.kirupa.com/t/drag-n-drop-question/25302/1 "2003-07-11T09:12:13Z")

</div>

hi im making this thing and i want to make this thing move by dragging it (i can do that already) but i want it so you go to the next keyframe and the object will be in the same place as you draged it.

any help??

```
                       Flash monkey:egg:
```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 11, 2003, 9:21am UTC](https://forum.kirupa.com/t/drag-n-drop-question/25302/2 "2003-07-11T09:21:01Z")

</div>

maybe you could get the x and y-position and save it into a variable in your first frame, like this:

[AS]on (release) {  
stopDrag();  
\_root.varx = \_root.yourmc.\_x;  
\_root.vary = \_root.yourmc.\_y;  
nextFrame();  
}  
[/AS]

then you can read the variables in the second frame and change the x and y-position of your dragged object

[AS]  
\_root.yourmc.\_x; = \_root.varx  
\_root.yourmc.\_y; = \_root.vary  
[/AS]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 11, 2003, 9:23am UTC](https://forum.kirupa.com/t/drag-n-drop-question/25302/3 "2003-07-11T09:23:49Z")

</div>

thanks ill try it now

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 11, 2003, 12:34pm UTC](https://forum.kirupa.com/t/drag-n-drop-question/25302/4 "2003-07-11T12:34:59Z")

</div>

wow it works but i wanted so you go to frame 2 and then you take off the script but when i take off the script from frame 2 it just goes back to it’s normal location can you help me?

ps. sorry if dont make sense i rushed for time sorry

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 11, 2003, 1:08pm UTC](https://forum.kirupa.com/t/drag-n-drop-question/25302/5 "2003-07-11T13:08:09Z")

</div>

you take off the script?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 11, 2003, 1:22pm UTC](https://forum.kirupa.com/t/drag-n-drop-question/25302/6 "2003-07-11T13:22:26Z")

</div>

GOD IM NOT THAT DUMB!!!

i have tried that but when i take off the script the object goes back to the starting off possition when you go to the next frame

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 11, 2003, 1:25pm UTC](https://forum.kirupa.com/t/drag-n-drop-question/25302/7 "2003-07-11T13:25:49Z")

</div>

no, i don’t know what that means… do you delete the script? why?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 11, 2003, 1:44pm UTC](https://forum.kirupa.com/t/drag-n-drop-question/25302/8 "2003-07-11T13:44:05Z")

</div>

i got a object in two frames but in the first frame i leave evrything the same but in the second frame i take of the actionscript from the object and it goes back to it starting place

if you still dont understand ask me for the fla

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 11, 2003, 1:50pm UTC](https://forum.kirupa.com/t/drag-n-drop-question/25302/9 "2003-07-11T13:50:28Z")

</div>

without the actionscript it goes back to its place, of course  
but why do you take off the actionscript

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 11, 2003, 1:52pm UTC](https://forum.kirupa.com/t/drag-n-drop-question/25302/10 "2003-07-11T13:52:37Z")

</div>

o poo poo i forgot to tell you i want it so you cannot drag it no more once your in frame 2

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 11, 2003, 1:54pm UTC](https://forum.kirupa.com/t/drag-n-drop-question/25302/11 "2003-07-11T13:54:51Z")

</div>

now i understand, well, you have to leave the script, but you’re using 2 different frames, so why don’t you just delete the startdrag action in your button

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 11, 2003, 1:57pm UTC](https://forum.kirupa.com/t/drag-n-drop-question/25302/12 "2003-07-11T13:57:32Z")

</div>

becouse when you take that bit off it goes back to it’s original place

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 11, 2003, 1:58pm UTC](https://forum.kirupa.com/t/drag-n-drop-question/25302/13 "2003-07-11T13:58:24Z")

</div>

o did you say button doesit matter if its not a button?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 11, 2003, 1:59pm UTC](https://forum.kirupa.com/t/drag-n-drop-question/25302/14 "2003-07-11T13:59:16Z")

</div>

mm, could you give me the fla

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 11, 2003, 2:02pm UTC](https://forum.kirupa.com/t/drag-n-drop-question/25302/15 "2003-07-11T14:02:14Z")

</div>

i could give you this fla i just made up and you could edit it?

press space to drop it

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 11, 2003, 2:10pm UTC](https://forum.kirupa.com/t/drag-n-drop-question/25302/16 "2003-07-11T14:10:36Z")

</div>

i gave your boxes the instance “box”, you forgot the second part of the AS in your frame, and I have deleted the actions on your mc in the second frame. I also added the AS to your arrow, so you don’t have to drop it first…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 11, 2003, 2:24pm UTC](https://forum.kirupa.com/t/drag-n-drop-question/25302/17 "2003-07-11T14:24:29Z")

</div>

thanks it worked

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 11, 2003, 3:20pm UTC](https://forum.kirupa.com/t/drag-n-drop-question/25302/18 "2003-07-11T15:20:31Z")

</div>

you’re welcome
