A couple of problems (gotoandplay with stop)

Hello there… while working on a game, I encountered some problems:

  1. I placed a stop command on a frame, but when a certain condition has been met, it goes to the frame I specified. Problem is, I used the gotoAndPlay command but it just stops in the frame that I specified to play. What’s wrong?

  2. I placed sound files at different frames. Now, when a player goes to the last frame (after meeting a condition), instead of playing just the sound file there, all the files behind it in the other frames play also. What’s wrong?

I hope someone could help… thanks.

Anyway, here’s part of the code. It tells the game to go to a specified frame if a condition has been met… does anything seem wrong? Please correct

*gtout is my timer, while attpow1 is just an attack power for player one…

this.onEnterFrame = function ()
{

_root.gtout += 0.2;



if (_root.gtout > 30)
{ 
  gtout=30;
 if (attpow1 > 0 < 20) 

{gotoAndPlay(21);
}
if (attpow1 > 19 < 40)
{gotoAndPlay(23);
}
if (attpow1 > 39 < 60)
{gotoAndPlay(24);
}
if (attpow1 > 59 < 80)
{gotoAndPlay(25);
}
if (attpow1 > 79 < 100)
{gotoAndPlay(26);
}
if (attpow1>99)
{gotoAndPlay(27);
}
}

}