# Power Bar

**URL:** <https://forum.kirupa.com/t/power-bar/16313>\
**Category:** flash\
**Created:** [March 23, 2003, 4:17pm UTC](https://forum.kirupa.com/t/power-bar/16313 "2003-03-23T16:17:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![BullDog\_Flash](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@BullDog\_Flash](https://forum.kirupa.com/u/BullDog_Flash)\
**Post date:** [March 23, 2003, 4:17pm UTC](https://forum.kirupa.com/t/power-bar/16313/1 "2003-03-23T16:17:07Z")

</div>

O.K my brain isent working today so…

I want a power bar.

Like i press the space bar and it goes up a little but if i dont press it it will go down.  
So if i get it up to half way it will go down if i dont keep pressing the space bar.

If you dont understand ill explin better.

Please please 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:** [March 23, 2003, 6:18pm UTC](https://forum.kirupa.com/t/power-bar/16313/2 "2003-03-23T18:18:35Z")

</div>

11 Views no replys hmm.

---

<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:** [March 23, 2003, 7:34pm UTC](https://forum.kirupa.com/t/power-bar/16313/3 "2003-03-23T19:34:38Z")

</div>

Come on some one got to know.

---

<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:** [March 23, 2003, 7:50pm UTC](https://forum.kirupa.com/t/power-bar/16313/4 "2003-03-23T19:50:26Z")

</div>

well i wont go into action scripting but basically you should do something like that:

- a loops that checks if the spacebar is press
- a function which will increment the size of a movie clip if the above loop is true
- another function in the loop which will decrement the size of the MC until it has reached zero…

Sorry i really dont have free time to make a fla about it…

---

<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:** [March 24, 2003, 3:08am UTC](https://forum.kirupa.com/t/power-bar/16313/5 "2003-03-24T03:08:30Z")

</div>

I am not sure I fully understand what you are trying to do, but create a bar movie clip with the registration point on the left middle.

Then apply these actions to a frame…  
[AS]bar.\_width = 1;  
\_root.onEnterFrame = function() {  
if (Key.isDown(Key.SPACE)) {  
bar.\_width += 1;  
if (bar.\_width\>=100) {  
bar.\_width = 100;  
}  
} else {  
bar.\_width -= 1;  
if (bar.\_width\<=1) {  
bar.\_width = 1;  
}  
}  
};[/AS]

Close?
