Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Flash: Really cool HP Bar Trick!

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
1,625
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Feb 4, 2010

this shows you how to keep your hp bar 100% to scale for whatever health you have. Ex: if you have 1,342,600 Hp, the hp will still stay 100% scale. very simple. very awesome

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 2 dislikes

Link to this comment:

Share to:
see all

All Comments (10)

Sign In or Sign Up now to post a comment!
  • what if I don't want it to let the number go negative and instead, there will be a window appearing or nothing happens?

  • You're using AS2, if I'm not mistaken, yes?

  • I've successfully recreated this (as much as intended upon doing so) and even added a few things. However, how would one go about creating a regenerating health bar (where the current hp variable would increase by 1 hp every, say, three seconds). Also, I'd like it if the hp bar would flash upon the current hp variable dropping. (It can't be dependent on the button, else it wouldn't work in a real situation.)

  • @ninefd bar.gotoAndStop(Math.ceil(maxH­ealth/health*100));

  • Best one i've seen! Keep up the good work (Y)

  • ok! wen it reaches zero it goes 2 the next bar... how u do that?

  • @ninefd its hard but it makes sense its tru

  • Personaly, I'd have two variables instead of one. hp and maxHp. That way when you put code it the bar you just say something like: this.scaleX = root.hp*(100/maxHp).

    When you hit next level it could just say something like "maxHp += random(50);

    hp = maxHp"

    and for ninefd

    "bar.gotoAndStop(hp)"

    something like that, I'm not as good with as2 as as3.

    Overall, a pretty good tutorial.

  • Instead of scaling it, how would i go about making it change frame, i have a 100 frame hp bar that i have created some effects that i would prefer over a green box.

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more