• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Trying to make Health Bar

New Here ,
Mar 13, 2010 Mar 13, 2010

Copy link to clipboard

Copied

I'm trying to make a health bar. I'm trying to make it so when your health goes down, the bar moves.


Health = 100;

HealthBar.TheBar._xscale = Health;

function updateHealthBar(){
    HealthBar.TheBar._xscale = Health;
}

So far thats what it does. I made a button, and when you press it, it takes your health down by 5.

How can I make just one side move to the left instead of them both moving towards the middle?

TOPICS
ActionScript

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 13, 2010 Mar 13, 2010

position TheBar so its registration point is along its left edge.

Votes

Translate

Translate
Community Expert ,
Mar 13, 2010 Mar 13, 2010

Copy link to clipboard

Copied

position TheBar so its registration point is along its left edge.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 13, 2010 Mar 13, 2010

Copy link to clipboard

Copied

Sweet.. That worked thanks...

Also, just another question..

Whenever I use the actions window in Flash CS4 it lags alot when I start getting alot of text in it. Is there a way to stop this lag? I have a really good computer.

When I use flash on my other computer it lags too.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 13, 2010 Mar 13, 2010

Copy link to clipboard

Copied

instead of typing text on-stage, create a dynamic textfield and type/assign the text property of your textfield.  that will eliminate that lag issue.

p.s.  please mark this thread as answered, if you can.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 13, 2010 Mar 13, 2010

Copy link to clipboard

Copied

So the lag in the actions window when im coding is because of static text?


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 13, 2010 Mar 13, 2010

Copy link to clipboard

Copied

LATEST

yes, though you might see the same problem if you placed a dynamic textfield on-stage and start typing or pasting a fair amount of text.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines