# Lifebar Decrease Coding (Help)

**URL:** <https://forum.kirupa.com/t/lifebar-decrease-coding-help/1144>\
**Category:** flash\
**Created:** [August 9, 2002, 11:39am UTC](https://forum.kirupa.com/t/lifebar-decrease-coding-help/1144 "2002-08-09T11:39:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeonGold](https://avatars.discourse-cdn.com/v4/letter/n/e5b9ba/32.png) [@NeonGold](https://forum.kirupa.com/u/NeonGold)\
**Post date:** [August 9, 2002, 11:39am UTC](https://forum.kirupa.com/t/lifebar-decrease-coding-help/1144/1 "2002-08-09T11:39:24Z")

</div>

Hi there, in the game I’m making, I’ve decided to replace the health (it only displays numbers) into a LIFEBAR just like what you see in Street Fighter and other fighting games…

So how do you do a lifebar that decreases depending on the value of your health?

Thanks in advance people…

---

<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 9, 2002, 12:38pm UTC](https://forum.kirupa.com/t/lifebar-decrease-coding-help/1144/2 "2002-08-09T12:38:40Z")

</div>

on (release) {  
attpow1 +=1;  
if (attpow1 \> 1 \< 9)  
{  
attack = “Sword Butt Stab”;  
}  
if (attpow1 \> 9 \< 19)  
{attack = (“Sword Powerful Slash”);  
}

}

- My problem is whenever I click on my button, it will say “Sword Powerful Slash” even though I haven’t clicked on it more than 9 times… 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:** [August 9, 2002, 12:40pm UTC](https://forum.kirupa.com/t/lifebar-decrease-coding-help/1144/3 "2002-08-09T12:40:14Z")

</div>

Found out that I just needed to remove the \> 9 thing hehe… anyway, I hope someone has the answer to my first problem…

---

<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 9, 2002, 12:45pm UTC](https://forum.kirupa.com/t/lifebar-decrease-coding-help/1144/4 "2002-08-09T12:45:54Z")

</div>

well i know what u mean u could us a slider or summet

-Tom

---

<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 9, 2002, 12:49pm UTC](https://forum.kirupa.com/t/lifebar-decrease-coding-help/1144/5 "2002-08-09T12:49:24Z")

</div>

I really hope there’s an actionscript way for this… hmm… maybe just making a lifebar movie clip then decreasing its \_width would work…

but wouldn’t that… uh… shall we say… “SHRINK TO THE CENTER” of the movie clip?
