# Drag and goto sene 2

**URL:** https://forum.kirupa.com/t/drag-and-goto-sene-2/21571
**Category:** Uncategorized
**Created:** [May 23, 2003, 4:43am UTC](https://forum.kirupa.com/t/drag-and-goto-sene-2/21571 "2003-05-23T04:43:16Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![cardjorg](https://avatars.discourse-cdn.com/v4/letter/c/a183cd/32.png) [@cardjorg](https://forum.kirupa.com/u/cardjorg)
#### Post date: [May 23, 2003, 4:43am UTC](https://forum.kirupa.com/t/drag-and-goto-sene-2/21571/1 "2003-05-23T04:43:16Z")

</div>

can anyone help please?

I want to drag a button to a rectangle and when i drop it, it’ll go to sene 2 i attached this fla so you get an idea of what i want ant tell me what did I do wrong.

and if you could fixed and attach the fla to see what you did that way I’ll learn more

thankyou

---

<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: [May 23, 2003, 7:39am UTC](https://forum.kirupa.com/t/drag-and-goto-sene-2/21571/2 "2003-05-23T07:39:33Z")

</div>

Well in this case, you can try this one.  
Considering the instance names you used, place this code in your “circle\_mc” clip:  
[AS] onClipEvent (mouseDown) {  
if (this, hitTest(\_root.\_xmouse, \_root.\_ymouse)) {  
startDrag(this);  
}  
}  
onClipEvent (mouseUp) {  
stopDrag();  
}  
onClipEvent (enterFrame) {  
if (this, hitTest(\_parent.rec\_mc)) {  
\_parent.doWhatever();  
}  
}  
[/AS]

Havent tested it but that should work. If in case not, try using “\_root” instead of “\_parent”.

Hope it helps! 🙂

Cheers!

---

<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: [May 23, 2003, 11:30pm UTC](https://forum.kirupa.com/t/drag-and-goto-sene-2/21571/3 "2003-05-23T23:30:05Z")

</div>

That is exactly what I want but , like when you dropp the circle it will play scene 2 not just when you dragg it .

thanks:)

---

<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: [May 24, 2003, 2:33am UTC](https://forum.kirupa.com/t/drag-and-goto-sene-2/21571/4 "2003-05-24T02:33:10Z")

</div>

hmmm… just add this script into you onClipEvent(enterFrame) and onClipEvent(mouseUp)…

[AS]  
onClipEvent(mouseUp) {  
stopDrag();  
hit = 1;  
}  
onClipEvent(enterFrame) {  
if (hit==1) {  
if (this, hitTest(\_parent.rec\_mc)) {  
\_parent.doWhatever();  
}  
}  
hit=0;  
} [/AS]

Hope it helps. Check it out. I might be making mistakes. ok!

Cheers! :thumb:

---

<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: [May 24, 2003, 5:30am UTC](https://forum.kirupa.com/t/drag-and-goto-sene-2/21571/5 "2003-05-24T05:30:05Z")

</div>

Thanks a lot  
that’s exactly what i wanted  
you know what?

…You are my Heroe …you got an :A+:

---

<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: [May 24, 2003, 5:40am UTC](https://forum.kirupa.com/t/drag-and-goto-sene-2/21571/6 "2003-05-24T05:40:45Z")

</div>

guess what ?

I made it work on the example but on my real project it didn’t and i don’t see why could you help me a little more if I’m not bothering you?:q:

---

<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: [May 24, 2003, 5:51am UTC](https://forum.kirupa.com/t/drag-and-goto-sene-2/21571/7 "2003-05-24T05:51:45Z")

</div>

gotoand play… in your upper part… ( in the normal mode ) theres some options… where it says to witch scene you want to go

---

<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: [May 24, 2003, 6:50am UTC](https://forum.kirupa.com/t/drag-and-goto-sene-2/21571/8 "2003-05-24T06:50:15Z")

</div>

This is the real project that I’m doing so could you tell me what am I doing wrong please  
the only wright mc is the top one

Thanks

---

<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: [May 26, 2003, 3:16am UTC](https://forum.kirupa.com/t/drag-and-goto-sene-2/21571/9 "2003-05-26T03:16:08Z")

</div>

Cardjorg, Have figured it out already? Hmmm… I think so. But I’ll try lookin’ at your flash file. 🙂

---

<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: [May 26, 2003, 3:19am UTC](https://forum.kirupa.com/t/drag-and-goto-sene-2/21571/10 "2003-05-26T03:19:46Z")

</div>

Cardjorg!

You forgot to put your actionscipt function doWhatever in the first 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: [May 26, 2003, 5:26am UTC](https://forum.kirupa.com/t/drag-and-goto-sene-2/21571/11 "2003-05-26T05:26:49Z")

</div>

opps, my fault

I forgot about it and sorry about that but what should I change in the script for the other arm2 and arm3 because i want them to go to other scene too

I’m sory for bothering w/ my stupid questions but I have to do it if I want to get the job that I want

thanks, [COLOR=red]You’re still my Heroe[/COLOR] =)

---

<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: [May 26, 2003, 5:43am UTC](https://forum.kirupa.com/t/drag-and-goto-sene-2/21571/12 "2003-05-26T05:43:23Z")

</div>

thats not a problem… 🙂

ok… change your code function to:  
[AS]function doWhatever() {  
if (armSelected == 1) {  
//gotoAndPlay your Destination.  
}  
if (armSelected == 2) {  
//gotoAndPlay your Destination.  
}  
if (armSelected == 3) {  
//gotoAndPlay your Destination.  
}  
}  
[/AS]

… and once again… add this to your onClipEvent(mouseDown):

[AS]  
onClipEvent (mouseDown) {  
if (this, hitTest(\_root.\_xmouse, \_root.\_ymouse)) {  
startDrag(this);  
\_root.armSelected = \_name.slice(3);  
}  
}  
[/AS]

put the code onClipEvent(mouseDown), (mouseUp), and (enterFrame) respectively in your other clips. ok!

Don’t hesistate should you have any other questions. 🙂

Cheers! :thumb:

---

<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: [May 26, 2003, 6:32am UTC](https://forum.kirupa.com/t/drag-and-goto-sene-2/21571/13 "2003-05-26T06:32:30Z")

</div>

I put the script on but they all go to the same scene  
Take a look:eye:

---

<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: [May 26, 2003, 6:43am UTC](https://forum.kirupa.com/t/drag-and-goto-sene-2/21571/14 "2003-05-26T06:43:03Z")

</div>

Check your capitalisation. Name of your labels should be the same as with your function 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: [May 26, 2003, 7:12am UTC](https://forum.kirupa.com/t/drag-and-goto-sene-2/21571/15 "2003-05-26T07:12:36Z")

</div>

[SIZE=4]You just know it!!! Hurray!!! You are the boss!![/SIZE]  
thanks a lot I finally got it thanks to you and I was wondering if I could put you in my buddy list if you don’t mind? 😉

---

<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: [May 26, 2003, 7:14am UTC](https://forum.kirupa.com/t/drag-and-goto-sene-2/21571/16 "2003-05-26T07:14:41Z")

</div>

of course! I would be grateful… 🙂  
MSN: [rvanet3079@hotmail.com](mailto:rvanet3079@hotmail.com)  
AOL: nante79

---

<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: [May 26, 2003, 7:16am UTC](https://forum.kirupa.com/t/drag-and-goto-sene-2/21571/17 "2003-05-26T07:16:47Z")

</div>

And hey… I am no Boss… Im trying to help… That’s what a friend intends to do… 🙂 lolz
