PDA

View Full Version : Simple drag'n'drop question


chronicsmoke
11-01-2002, 05:52 PM
Hi,

I want my flash movie to jump to frame 3 as soon as a user has dropped 2 (or more) MCs on the correct target areas.

I did that with a nested if-statement on frame 1 of the actions layer of the main timeline (hitTest-method).

The problem: flash jumps to frame 3 as soon as the user drags the last movieclip over the target area. But I want the movie to jump as soon as the user releases the mouse button to drop the MC over the target area.

I tried to use the droptarget-property but it just won't work.

Any ideas anyone?

Thanks.

Xansi
11-01-2002, 06:19 PM
Maybe if you post the code your question will be easer to answer.:D

jubei
11-07-2002, 01:45 AM
I'd do it by having each object dragged have an if statement relating to when it's dropped, so, for example, on release, if it's dropped in the right place, add 1 to a score variable.

Then create a loop that says when the score variable reaches 2, it goes to the third frame.

You just might need to make sure you disable the dragging ability if they drop it in the right place, so they can't just drop the same object twice.

Ricod
11-08-2002, 03:12 PM
Otherwise, try a function. You can write this one once (on the 1st frame if you would like) and call this from anywhere. (if you named it "hitCounter" and wrote it on the main timeline, the path would be _root.hitCounter(); )