# Character hitting area

**URL:** https://forum.kirupa.com/t/character-hitting-area/260283
**Category:** Uncategorized
**Created:** [May 14, 2008, 4:59am UTC](https://forum.kirupa.com/t/character-hitting-area/260283 "2008-05-14T04:59:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![alejandramilla](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@alejandramilla](https://forum.kirupa.com/u/alejandramilla)
#### Post date: [May 14, 2008, 4:59am UTC](https://forum.kirupa.com/t/character-hitting-area/260283/1 "2008-05-14T04:59:57Z")

</div>

i have a character, (pawel) this one hits on a set of tree coins (mccorrecto) in this point i have the answer, the problem is… when pawel hits mccorrecto in other part of the movie, most apear tree numbers (280, 340, 460) = i have to do an excercise with number of secuences = so i have this script

for mi coin (mccorrecto)

onClipEvent (enterFrame) {  
if (this.hitTest(\_root.pawel)) {  
\_root.score.text++;  
gotoAndStop(“hit”);//i was trying to go to an other frame of the time line//it didnt work  
\_root.intento.text++;  
unloadMovie(this);  
}  
}

for pawel

onClipEvent (enterFrame) {  
if (Key.isDown(Key.RIGHT)) {  
\_X+= 5;  
legs.play();  
} else if (Key.isDown(Key.LEFT)) {  
\_X-= 5;  
legs.play();  
}  
if (Key.isDown (Key.DOWN)) {  
\_y+=5;  
legs.play();  
}  
if (Key.isDown (Key.UP)) {  
\_y-=5;  
legs.play();  
}  
}  
//in this i was trying, If (pawel.hitThis) { (\_root.mccorrecto)}

i hope that some one can help me with this… im learning action script but the books are not helping neither the tutorials

---

<div class="post-metadata">

### Author: ![Pier25](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Pier25](https://forum.kirupa.com/u/Pier25)
#### Post date: [May 14, 2008, 9:06am UTC](https://forum.kirupa.com/t/character-hitting-area/260283/2 "2008-05-14T09:06:59Z")

</div>

Maybe it’s too late for this, but…

Instead of detecting when the character hits a zone, you could call a function depending on the option the user has chosen.

Maybe your problem with gotoAndStop is you need to specify a target like \_root.gotoAndStop or my\_mc.gotoAndStop or this.gotoAndStop

😉

---

<div class="post-metadata">

### Author: ![alejandramilla](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@alejandramilla](https://forum.kirupa.com/u/alejandramilla)
#### Post date: [May 15, 2008, 1:52am UTC](https://forum.kirupa.com/t/character-hitting-area/260283/3 "2008-05-15T01:52:56Z")

</div>

can you help me doing all the action script with the sentence my\_mc.gotoAndStop because i dont know in wich frame i have to put it or how should i start the sentence

---

<div class="post-metadata">

### Author: ![Pier25](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Pier25](https://forum.kirupa.com/u/Pier25)
#### Post date: [May 16, 2008, 8:39am UTC](https://forum.kirupa.com/t/character-hitting-area/260283/4 "2008-05-16T08:39:59Z")

</div>

Well I can help, but I can’t make it for you…

Please tell me, without code, what you want to accomplish and I can give you a general approach. 😉
