|
metadata
This is exactly what I did.
I drew a black rectangle edge, and converted it to a MC. I did not export it for AS but I gave it the instance name healthMeter.
Than I made a green rectangle that fit inside the black bar. I converted it to a MC did not export anything as AS and gave it the instance name bar.
I moved the green MC over the black rectangle MC so it looks like the health bar and it didn’t work. Note: I also have this on the same layer as “ship”.
What did I do wrong? I followed the tutorial properly right?
|
|
|
metadata
Make Rectangle
make new layer
make 2nd rectangle on new layer. make it a MC and export for as, make it an Instance of bar
|
|
|
metadata
So the first rectangle is just a border. It doen’t get converted to a MC? I make it on the same layer as ship.
Then the new layer has just the green rectangle and that is converted to the MC and given the instance name?
|
|
|
metadata
the first rectangle can be a MC it doesn’t really matter as it’s not being SIZED.
the 2nd layer needs to be a MC though, so when it’s called to be sized it can be sized properly.
Rectangle MC = healthMeter
Meter MC 2nd layer = healthMeterBar (properties of this MC should not be exported for AS)
which is an instance of bar (which you set by clicking on the picture and filling in under Move Clip in the Properties tab down on the bottom.)
so you can call healthMeter.bar
|
|
|
metadata
I do not understand this at all. How many movie clips do I need to make for my health bar. Two or one?
I made a new layer call health meter layer in my timeline. Here I made an empty rectangle and converted it to a MC “healthMeter” with the instance name “healthMeter”. Then I made another MC “healthMeterBar” with the instance name “bar”. I moved my green MC inside the empty black border MC and it doesn’t work.
How do I make this health bar. I don’t understand how it works :(
|
|
|
metadata
You need Two(2) MC in Total(all together).
One will be called healthMeter
One will be called healthMeterBar
You will create healthMeter
Make a Rectangle
f8 make it a MC but don’t export for AS – this will be named healthMeter
add another layer
make another rectangle this one will be filled
f8 make it a MC and don’t export – this will be named healthMeterBar
the properties at the bottom showing for the above item should have a Link to field
put in bar in the Link To
this should work… of course I’m learning this all fresh as you are so I hope I’m not wrong, but this is the way I made my Health bar, my Enemy Health Bar, etc.
|
|
|
metadata
Okay, I will try this when I get home from work. Hopefully when I follow the steps it will come out right. Thankyou very much for your patience.
The only step that confuses me now is the add another layer. Is that another layer in my timeline?
|
|
|
metadata
In health meter.
First there is layer in root timeline, in which healthMeter is located. Then open that clip, add background for bar, make new layer into movie clip and put healthMeterBar there. If i remember right, it needs instance name ‘bar’ (if you do it according to tutorial). And make the registration point for bar in left side edge.
|
|
|
metadata
I have been trying this for over an hour and feel retarded. No matter what I do it doesn’t work.
I made a rectangle in a new layer on my timeline. I converted it to a MC with the name helathMeter. Then I right clicked on it and hit edit. I added a new layer and here mad the green rectangle. I converted it to a MC with the name healthMeterBar and gave it the instance name bar. After I gave the MC on my root timeline the instance name healthMeter. It still does not work and I am out of ideas.
|
|
|
metadata
According to the Shootorial, you need a movie clip named “healthMeter”. Inside it you need a movie clip named “bar”.
To do this, make your healthMeter movie clip on the stage then double click on it. Then draw the bar that goes inside it, and convert that bar (but not the surrounding box) into a movieclip. Give the movieclip the name “bar”, click the box “export for Actionscript” and give it the identifier “bar”, don’t give it a class, and then do give it the instance name “bar”.
This should work with the code from the Shootorial—at least it did for me, so I’d be surprised if it didn’t.
If it doesn’t, though, then it would be helpful to post a description of what happens, especially if it gives any errors.
|
|
|
metadata
I have tried all of what you posted too. UGH!
I have uploaded my game again in hopes that you could tell me my error.
[http://www.megaupload.com/?d=DBSFB72W](http://www.megaupload.com/?d=DBSFB72W)
That is my entire game with my healthbar failure. If you could tell me what’s wrong it’d be appreciated.
|
|
|
metadata
[deleted bits about the file not extracting at all]
I got it to extract, but I think my Flash version is too old … I have MX and it reports an unexpected format when I try to open your .fla.
The updateHealth function looks fine though.
|
|
|
metadata
Weird, maybe it’s a problem with megaupload
try this
[http://rapidshare.de/files/40859650/PenguinSHOOT.rar.html](http://rapidshare.de/files/40859650/PenguinSHOOT.rar.html)
|
|
|
metadata
Whoops, sorry. No, that was probably a problem with StuffIt; I downloaded a newer rar extractor and that handled it fine. Now the problem is that MX won’t open your .fla file, so I can’t take a look at the timeline….
|
|
|
metadata
Hmmm…any other way to do it?
|
|
|
metadata
I fixed it! This tutorial was done lazily. I logically found my error, the tutorial never tells you to set the health to 100 in the code.
|
|
|
metadata
Awesome. I’m glad you solved it.
|
|
|
metadata
You were even more lazy, there have been at least 4 people with the same problem on this forum, and everytime they were told the same…
|
|
|
metadata
Ohh noes teen angst! Calm down, no one told me.
|
|
|
metadata
It’s not their job to tell you it’s yours to search for answers, but whatever.
|
|
|
metadata
|
|
|
metadata
“It’s not their job to tell you "
Actually the job or purpose if you will of the shootorials is exactly that.
|
|
|
metadata
I was wondering if anyone could help me out with my health bar. everything seems to be coded correctly and there are no errors reported, but no changes can be seen on my health bar MC.
Here is my code:
[http://www.megaupload.com/?d=05V3LZ50](http://www.megaupload.com/?d=05V3LZ50)
If u need n3 more nfo just let m3 kno.
|
|
|
metadata
Did you set health equal to zero?
|
|
|
metadata
the initial value that i gave to health was 100 through the use of the resetHealth() function called in the onLoad() function of ship.
|