# Current Variables

**URL:** <https://forum.kirupa.com/t/current-variables/159246>\
**Category:** flash\
**Created:** [August 16, 2005, 1:19am UTC](https://forum.kirupa.com/t/current-variables/159246 "2005-08-16T01:19:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vulshok](https://avatars.discourse-cdn.com/v4/letter/v/96bed5/32.png) [@Vulshok](https://forum.kirupa.com/u/Vulshok)\
**Post date:** [August 16, 2005, 1:19am UTC](https://forum.kirupa.com/t/current-variables/159246/1 "2005-08-16T01:19:32Z")

</div>

Im having problems with some coding of mine.

Here’s the problem:

First I’ve delcared these variables on frame 1:

```auto
 
STR = 10
DEF = 7
INT = 5
hp = maxHP
mana = maxMP
hpLoss = .9
mpLoss = 1 

```

frame 2:

```auto
 mana = maxMP*mpLoss;
hp = maxHP*hpLoss;
maxHP = (STR*3)+(DEF*10);
maxMP = (INT*10);
HPpercent = hp/maxHP;
MPpercent = mana/maxMP;
HPBAR._width = HPpercent*84;
MPBAR._width = MPpercent*84;
 
stop(); 

```

The problem is when an item is picked up (+10hp), the hp variable gets the proper value increase. But the width of HPBAR stays the same.

The game runs off frame 2 and must stay there for the rest of the code to function properly.

All input would be greatly appreciated.

If its an obvious answer, feel free to make sure I never forget again.

p.s. How do you wrap those nice little actionscript tags around your post?
