Drag and goto sene 2

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

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! :slight_smile:

Cheers!

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:)

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:

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

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

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:

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

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

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

Cardjorg!

You forgot to put your actionscipt function doWhatever in the first frame!

:slight_smile:

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] =)

thats not a problem… :slight_smile:

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. :slight_smile:

Cheers! :thumb:

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

Check your capitalisation. Name of your labels should be the same as with your function script. :slight_smile:

[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? :wink:

of course! I would be grateful… :slight_smile:
MSN: [email protected]
AOL: nante79

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