# Can anyone help with this?

**URL:** <https://forum.kirupa.com/t/can-anyone-help-with-this/14819>\
**Category:** Uncategorized\
**Created:** [March 3, 2003, 5:58am UTC](https://forum.kirupa.com/t/can-anyone-help-with-this/14819 "2003-03-03T05:58:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sbDien](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@sbDien](https://forum.kirupa.com/u/sbDien)\
**Post date:** [March 3, 2003, 5:58am UTC](https://forum.kirupa.com/t/can-anyone-help-with-this/14819/1 "2003-03-03T05:58:57Z")

</div>

i’m trying to get the logic right for the error checking for this game i’m trying to develop.

it’s a drag and drop game…

there are 4 objects on the stage and they have to be dragged to a specific target.

Object1 goes to the target. Object2 goes to the target as well but what i really want is to make the rest of objects dependant on the previous object.

I tried changing the ‘target’ of the objects to the previous, but what i really want is to make the object lock in place and only allow them draggable if former objects are in place.

thanks,  
dien

---

<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:** [March 3, 2003, 7:52am UTC](https://forum.kirupa.com/t/can-anyone-help-with-this/14819/2 "2003-03-03T07:52:33Z")

</div>

Okay… So basically you wanna set something up where you can only drag an object if the one prior to it’s correctly placed?

Hmm Well I’d suggest having a variable…

And then… Having an if statement that would say… if variable == 1 or something then allow the next object to be dragged around…

Then just have the number keep going higher… if the number is over a certain amount then it allows the next object to be dragged around…

---

<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:** [March 3, 2003, 8:41am UTC](https://forum.kirupa.com/t/can-anyone-help-with-this/14819/3 "2003-03-03T08:41:46Z")

</div>

> \*Originally posted by playamarz \*  
> \*\*Okay… So basically you wanna set something up where you can only drag an object if the one prior to it’s correctly placed?

Hmm Well I’d suggest having a variable…

And then… Having an if statement that would say… if variable == 1 or something then allow the next object to be dragged around…

Then just have the number keep going higher… if the number is over a certain amount then it allows the next object to be dragged around… \*\*

hi playamarz,

thanks for the suggestion, that was what i wanted to do in the beginning.

But due to my inexperience i can’t implement it. basically, its the programming hierachy i can’t get. I tried using the if/else statement outside the on(press) handler. didn’t work. so i tried with a onClipEvent handler… debugger came back with “…handler cannot be inside handler…”

erm… can i get a little more help?

thanks!
