tags:

views:

342

answers:

2

I have 5 separate movie clips on stage. I would like to drag and drop 1 movie clip inbetween the other 2 movie clip so I can put the movie clips in order.

Basically, its a quiz. Say you have redSquare(movieclip), blueSquare(movieclip), black Square(movieclip), orangeSquare(movieclip)

The correct order is: blueSquare,Blacksquare,OrangeSquare,RedSquare.

I want the movie clips to be jumbled and then user will drag and drop movie clips in order. I know how to start and stop drag but I don't know how to drag movie clip inbetween 2 movie clips.

Any help or suggestion?

Thank you

A: 

Hi, I can help, can you send me the file?

It's very simple, you can do use "hitTestObject." (This might be the simplest solution for you if you aren't an expert)

Using "hitTestObject" you can create matching invisible squares that act as guides on where hey have to place they visible squares, once the hit submit you run a hitTestObject for each visible square and their matching invisible guide. It returns a boolean answers, so you can just do a simple if statement that checks all of them at once, and if all pass you do your next move.

Again, it's a big vague but I'll be more than happy to help if I can see what you are trying to do :D

joseeight
A: 

Thank you Jose,

I don't know how to post the files on this website. Actually I have already done what you suggested and it works. (I have included only 2 squares but it will have more in final poject)

Here is the code and it works but my boss wants something like this please: http://oil.otago.ac.nz/oil/module1/Use-information/Cite-and-reference-your-information/How-you-cite/Activity.html

red_mc.onPress = function() { this.startDrag(); }; red_mc.onRelease = function() { this.stopDrag(); }; green_mc.onPress = function() { this.startDrag(); }; green_mc.onRelease = function() { this.stopDrag(); }; this.check_btn.onPress = function() { if ((eval(red_mc._droptarget) == hitRed_mc) && (eval(green_mc._droptarget) == hitGreen_mc) ) { trace("correct"); } else { trace("wrong"); } };