Macromedia Flash CS3 Tutorial 4: Making a health bar

Loading...

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

Uploaded by on Feb 6, 2009

Hey guys here is the codes for making your game:
Enemy:
onClipEvent(enterFrame){
if(_root.char.hitTest(this)){
_root.hp--;
}
}

Button:
on(release){
gotoAndPlay(1);
}

Thanks for watching
Comment,
Rate,
Subscribe,

For some reason it will not let me put the health bar code in the description so check the comments and there will be a health points code to put on the health bar.

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 3 dislikes

Link to this comment:

Share to:

Uploader Comments (VampieGames)

  • HP Bar:

    onClipEvent(enterFrame){

    this._xscale = _root.hp;

    if(_root.hp<=0){

    _root.gotoAndStop(2)

    }

    }

  • hey, i need some help, i did all of these but when i start actualy playing i die when i start, what can it come from?

  • have you put hp = 100; in the frame??

    hope this helps

  • HP Bar:

    onClipEvent(enterFrame){

    this._xscale = _root.hp;

    if(_root.hp<=0){

    _root.gotoAndStop(2)

    }

    }

see all

All Comments (26)

Sign In or Sign Up now to post a comment!
  • macromedia flash cs3 is not

    adobe flash cs3 is sai ......Learn the name

  • for some reason your hp bar code isn't working for me,

    flash says that there needs to be an operand after "="

  • what program you use to record????

  • @JoMaJe9999

    just doubleclick on the enemy and the animate the movement

  • @piattrocks

    the frame

  • I made a heart with this code:

    onClipEvent(enterFrame){

    if(_root.char.hitTest(this)){

    _root.hp=100;{

    unloadMovie(this);

    }

    }

    }

  • stop();

    hp = 100;

    are actions for the first frame of the file or for the health bar?

  • i'm working through this video as well. So far I've been very happy with them all, so thank you again for sharing! The biggest point of confusion for me is when you put an action in, I can't always tell what you have selected (or worry that i'm applying actions to the wrong thing - like image actions vs frame actions, i suppose). Should I be making a new file for each tutorial, or be using the same one?

  • thanks again

  • If you're working on making your own, I'd take a look at it. But what would be cool if you could help with something like this video is doing, like a tutorial. Share the knowledge!

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