on (release) { if (money >= 100) { money -= 100; _root.player.goodguy.sword.gotoAndPlay(2); } }
But the player has 5 frames in the player mc and in each of those movie clip frames he does a fight move i have this on another frame
PHP Code: function onEnterFrame() { if (players_turn) { if (player_attack && player.attack_mc._currentframe == player.attack_mc._totalframes) { //if the player is attacking enemy_health -= 20+random(20); //damage the enemy player_attack = false; //the attack is over players_turn = false; //the turn is over player.gotoAndStop(1); //player look normal again } else if (player_magic && player.magic_mc._currentframe == player.magic_mc._totalframes) { //if the player uses magic enemy_health -= 3*random(20); //damage the enemy with a bit of risk player_magic = false; players_turn = false; player.gotoAndStop(1); the problem is that attack_mc and magic_mc have the old sword in it
the only mc that has the new sword is of course _root.player.goodguy.sword.gotoAndPlay(2);
Now how do i go to frame 2 on all those mcs. the 3 mcs in the player mc have the sword mc in them how in the world do i universally but that sword mc to frame 2 with one button push
var weaponArr:Array = new Array(); weaponArr["sword1"] = swordMC; weaponArr["sword2"] = swordMC2;
It depends on how they will be fitted in your hierarchy. I would probably add them to the player's attributes by putting them in a superclass or assigning them in the player's constructor (or when he's instantiated).
I don't think your syntax is right the only way I know of to use a for loop is for(initial, condition, increment) so if I wanted to trace the numbers 1 - 5 var i:Number; for(i = 1; i <= 5; i++) { trace(i); }