View Full Version : Setting an order for a drag movieclip game

09-03-2003, 06:29 AM
Hi... am working on a small drag movie clip game where I have to assemble different parts of a bike... I have 5 parts which I have to drag into the correct area for it to stick and on completing all 5 parts of the bike, it forms the bike.... simple dragmovieclip game using startdrag and hittest. This, I am able to do so easily.:)

Now, I have a problem in trying to set an order... For example, the guy has to first put the chassis and then the tank etc...

Ordinarily, if you place the tank in the hittest area of the tank, it will stick... this is what most of these dragmovie games have... What I need is how to set an order to simulate the actual process of building a bike.... in the sense, to build a bike, you first need a chassis, then the tank, the engine etc... the flow and process... so how do i validate the same for this movie?? Like only after putting part 1(chassis), will part 2 (engine) stick etc... these kind of conditions.

Can somebody please help me on this...

Thanks a lot

09-03-2003, 10:12 AM
use a variable to track whether the clip has been placed.

So when the chassis is dropped into place it changes the value of the variable chassisInPlace to equal true ( chassisInPlace=true ). Then use that on your hitTest code.

if(this.hitTest() && chassisInPlace==true) {
//put it in place;


09-04-2003, 01:07 AM

Thanks a lot... will trying controlling it using a variable and check the condition. I managed to solve the problem yesterday by putting it in different scenes and enabling the hittest option for only one single part in a scene. Onhit, it goes to the next scene, where the next part would be hittest enabled... hence I got it this way.

I'll try the variable, as it should be much simpler and neater to do... thxs a lot:).