# Hit test problem

**URL:** <https://forum.kirupa.com/t/hit-test-problem/27549>\
**Category:** Uncategorized\
**Created:** [August 4, 2003, 1:09am UTC](https://forum.kirupa.com/t/hit-test-problem/27549 "2003-08-04T01:09:41Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![cardjorg](https://avatars.discourse-cdn.com/v4/letter/c/a183cd/32.png) [@cardjorg](https://forum.kirupa.com/u/cardjorg)\
**Post date:** [August 4, 2003, 1:09am UTC](https://forum.kirupa.com/t/hit-test-problem/27549/1 "2003-08-04T01:09:41Z")

</div>

could any one help please  
im doing a quizz and im having problems keeping score the students must dragg 16 to the log but for each frog they dragg to the log they get 100 points and i can’t get that to happen I belive the problem is in the variables but can’t figure it out  
help is greatly apreciate thanks :A+: 🙂

PS here is the fla  
[http://www.geocities.com/cardjorg/test2.fla](http://www.geocities.com/cardjorg/test2.fla)

---

<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:** [August 4, 2003, 2:18am UTC](https://forum.kirupa.com/t/hit-test-problem/27549/2 "2003-08-04T02:18:48Z")

</div>

I’m sorry, I had to erase all of your actions and start all over again. You can look over the actions I put, they’re all pretty self explanitory - I think. If you have questions, lemme know!! :beam:

[http://www.freddythunder.com/test/frogger.fla](http://www.freddythunder.com/test/frogger.fla)

---

<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:** [August 4, 2003, 2:34am UTC](https://forum.kirupa.com/t/hit-test-problem/27549/3 "2003-08-04T02:34:15Z")

</div>

thanks a lot !!  
but there is still a problem , i tried this last time but i couldn’t figure out a condition so if you dragged a frog out of the log it would take off the 100 points given or if you pressed it won’t add 100 more any ideas??😉 :ch: :rambo:

---

<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:** [August 4, 2003, 2:39am UTC](https://forum.kirupa.com/t/hit-test-problem/27549/4 "2003-08-04T02:39:20Z")

</div>

On ALL of your frogs, add this line in the if statement:  
else { \_root.textbox -= 100; }  
Should look like voila:

```auto

on(press){
	this.startDrag(true);
}
on(release){
	stopDrag();
	if (this.hitTest(_root.woodlog)){
		_root.textbox += 100;
		this._y = _root.woodlog._y;
	} else {
		_root.textbox -= 100;
	}
}

```

Tell your students I said hi!!

---

<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:** [August 4, 2003, 3:17am UTC](https://forum.kirupa.com/t/hit-test-problem/27549/5 "2003-08-04T03:17:38Z")

</div>

but if you press in the frog inside the target area it adds 100  
and the same thing happens when you clik the frog outside the target area

---

<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:** [August 4, 2003, 3:30am UTC](https://forum.kirupa.com/t/hit-test-problem/27549/6 "2003-08-04T03:30:49Z")

</div>

Okay, this will take more code. How many times do you anticipate the frogs to move? Is it just on the log, then you’re done, or on the log, then off the log? Give me a little plot-line of what you want done.

---

<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:** [August 4, 2003, 3:43am UTC](https://forum.kirupa.com/t/hit-test-problem/27549/7 "2003-08-04T03:43:34Z")

</div>

just in to the log but you see they are first grade students and i belive some are going to have trouble to count and will want to dragg out some or add more frogs

---

<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:** [August 4, 2003, 3:50am UTC](https://forum.kirupa.com/t/hit-test-problem/27549/8 "2003-08-04T03:50:20Z")

</div>

Holy crap, I did it. I thought it would be a lot harder that what I did, so, here ya go:

[http://www.freddythunder.com/test/frogger.fla](http://www.freddythunder.com/test/frogger.fla)

:beam:

---

<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:** [August 5, 2003, 4:12pm UTC](https://forum.kirupa.com/t/hit-test-problem/27549/9 "2003-08-05T16:12:14Z")

</div>

thanks alot it worked perfectly!!!  
the students liked

---

<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:** [August 5, 2003, 4:20pm UTC](https://forum.kirupa.com/t/hit-test-problem/27549/10 "2003-08-05T16:20:00Z")

</div>

Just helpin’ the kids - it’s what I do…😛
