Actionscript 3: Healthbar and Button <p>So basically I am making a game in which a button is clicked to decrease the amount of health in a healthbar. I have a button on the stage named fortyfivedown_btn, and a healthbar, which is a 101 frame (includes zero) movieclip. The health bar has an instance name of lifebar. On the stage, the button coding is:</p> <pre><code>fortyfivedown_btn.addEventListener(MouseEvent.CLICK, fortyfivedownClick); function fortyfivedownClick(event:MouseEvent):void{ lifebar.health = lifebar.health-45; } </code></pre> <p>Inside the healthbar movieclip, I have a layer of coding that is:</p> <pre><code>var health:int = 100; gotoAndStop(health + 1); if(health &lt; 0) health = 0; else if(health &gt; 100) health = 100; gotoAndStop(health + 1); </code></pre> <p>So, there is my coding. The thing is, when the button is clicked, the healthbar does not go down. I traced the health variable in the button:</p> <pre><code> fortyfivedown_btn.addEventListener(MouseEvent.CLICK, fortyfivedownClick); function fortyfivedownClick(event:MouseEvent):void{ lifebar.health = lifebar.health-45; } { trace(lifebar.health); } </code></pre> <p>I saw that the output is 0. For some reason the button believes the health is 0, when I declared it was 100 inside the healthbar movieclip? Any help is appreciated.</p> <p>(Edit)</p> <p>Alright, in answer to the trace question, if I don't do it like that, there is no output. I should say I'm a beginner at this all, and am learning as I go, so please bear with me. Here is my fla file:</p> <p><a href="https://skydrive.live.com/embed?cid=9AB08B59DCCDF9C6&amp;resid=9AB08B59DCCDF9C6%21107&amp;authkey=AGqFHhlHnvOXvuc" rel="nofollow">https://skydrive.live.com/embed?cid=9AB08B59DCCDF9C6&amp;resid=9AB08B59DCCDF9C6%21107&amp;authkey=AGqFHhlHnvOXvuc</a></p>