# Keeping score and detecting lives

**URL:** <https://forum.kirupa.com/t/keeping-score-and-detecting-lives/102268>\
**Category:** Uncategorized\
**Created:** [February 21, 2004, 3:56pm UTC](https://forum.kirupa.com/t/keeping-score-and-detecting-lives/102268 "2004-02-21T15:56:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bombsledder](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@bombsledder](https://forum.kirupa.com/u/bombsledder)\
**Post date:** [February 21, 2004, 3:56pm UTC](https://forum.kirupa.com/t/keeping-score-and-detecting-lives/102268/1 "2004-02-21T15:56:00Z")

</div>

alright you are all probably tired of answering my questions,but

im trying to create a dynamic text box so when there is a hit

collision between my two objects. say a ball and another ball a life

is deducted from the life text box. and at 0 lives you goto the 2nd

frame.

thanks for all the help

---

<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:** [February 21, 2004, 8:26pm UTC](https://forum.kirupa.com/t/keeping-score-and-detecting-lives/102268/2 "2004-02-21T20:26:21Z")

</div>

[AS]  
onClipEvent(enterFrame){  
if(this.hitTest(\_root.ball2)){  
\_root.life = \_root.life - 1;  
}  
if(\_root.life == 0){  
gotoAndStop(2)  
}  
}  
[/AS]

---

<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:** [February 21, 2004, 11:08pm UTC](https://forum.kirupa.com/t/keeping-score-and-detecting-lives/102268/3 "2004-02-21T23:08:46Z")

</div>

yes thanks i just have one problem.

when (well in my case a ball hits the rectangle and the score just

keeps going down.

i want it to play from the beginning but with one life less, and

when zero lives left play()2.

do you think you can tell me whats rong, and if you dont

understand i will try saying in easier

---

<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:** [February 21, 2004, 11:10pm UTC](https://forum.kirupa.com/t/keeping-score-and-detecting-lives/102268/4 "2004-02-21T23:10:16Z")

</div>

o wate if you want i can attach the file and put it on a new thread!
