Movieclip[something] - Possible?
Well actually Im almost sure it is, except I dont know exactly how to do it because it doesnt seem to be working for me.
Anyways, let me explain whats happening
You have game (yes this should be in the game section, but its more of a general question ;) ) and this game has three lives. The lives are showing by icons , when you die , one of the icons will dissapear
Each icon has the instance name of life1, life2, life3 and are located within the movieclip gameInterface
Now on my first frame actions layer on the *main* timeline, I have a bunch of code. Basically, a portion of this code checks to see if the health of your character ever goes below and equal 0. If so , your dead. And the variable lives = 3; is reduced by one (all contained in the same frame actions)
Now the problem is here:
code:
if (health<=0) {
_root.ship.gotoAndPlay("dead");
health = 100;
_root.gameInterface.life[lives]._visible = false;
lives--;
_root.gameInterface.healthBar._xscale = 50;
} else if (health == 30 || health>30) {
_root.gameInterface.light.gotoAndPlay("startLight" );
}
You can see where it checks if the health is less or equal to zero. The ship then goes and plays from the 'dead' frame.
The health is then put back to full life as you start the level over.
Now the problem lies on the next line:
code:
_root.gameInterface.life[lives]._visible = false;
I simply want to make one of the life icons dissapear. So since they're are named life1, life2, life3, I thought that using the lives =3; variable would be smart to know which one dissapears
code:
_root.gameInterface.life[lives]._visible = false ;// make life3 invisible
lives--; // lives goes down to 2
So when the next time you die, life2 should dissapear
Make sense? Hopefully it does and hopefully someone could assist me :)
Thanks :D