# 2 same hitTest. help me

**URL:** <https://forum.kirupa.com/t/2-same-hittest-help-me/193916>\
**Category:** flash\
**Created:** [July 19, 2006, 9:09am UTC](https://forum.kirupa.com/t/2-same-hittest-help-me/193916 "2006-07-19T09:09:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TvFreak](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@TvFreak](https://forum.kirupa.com/u/TvFreak)\
**Post date:** [July 19, 2006, 9:09am UTC](https://forum.kirupa.com/t/2-same-hittest-help-me/193916/1 "2006-07-19T09:09:43Z")

</div>

i created 3 variables tht is dropBool(scale),waterBool(cylinder) and ansBool(batteryAns)

the codes are working well but there is a slight problem.

i hav two hitTest which is one at the ‘shelf’ and the other is at ‘else’. the x and y hits the same co ordinates.

as for hitTest at 'shelf ’

dropBool and waterBool need to false and ansBool need to b true to allow BatteryAns visible.

as for hitTest at ‘else’

All,dropBool,waterBool and ansBool need to false  
to make batteryAns nt visible.

-so the problem is

if u drag batt \> scale \> back to shelf \> batteryAns appear.

or

if u juz double click the battery at the shelf itself , batteryAns will appear also cause it hit the same place.

i need the user to do the drag n drop activity 1st before getting the answer.

How can i solve dis? i tried so many ways but still cannot work.  
\</SPAN\>

```auto
else if (this.hitTest(_root.shelf_mc)) { 
      dropBool = false; 
      waterBool = false; 
      answer2(); 
      ansBool = true; 
      answer(); 
      this._x = 88.5; 
      this._y = 31; 
      _root.answer1 = ""; 
      _root.answer2 = ""; 
      _root.answer3 = ""; 
      _root.endComment = ""; 
      _root.batteryAns._visible = true; 
      _root.msg_mc._visible = false; 
      _root.water_mc._visible = true; 
      _root.waterBattery_mc.gotoAndStop(1); 
      _root.error_mc.gotoAndStop(1); 
      enabler("crazly", true); 
      trace(shelf_mc+" "+ "shelf"); 

```

```auto
else { 
      dropBool = false; 
      waterBool = false; 
      answer2(); 
      ansBool = false; 
      answer(); 
      battery_mc._alpha =100; 
      this._x = 88.5; 
      this._y = 31;  
      _root.answer3 = ""; 
      _root.answer1 = ""; 
      _root.answer2 = ""; 
      _root.endComment = ""; 
      _root.msg_mc._visible = false; 
      _root.water_mc._visible = true; 
      _root.waterBattery_mc.gotoAndStop(1); 
      _root.error_mc.gotoAndStop(1); 
      enabler("crazly", true); 
   } 

```

ps: heres the link for my fla file

[http://www.filewire.com/download.php?id=9382f33a1c6aa3565edf01e](http://www.filewire.com/download.php?id=9382f33a1c6aa3565edf01e)

note: i hav two code area. One at layer name action frame 1 and the other one is at layer name waterBattery,it is inside a movieClip frame35
