# A couple of problems (gotoandplay with stop)

**URL:** <https://forum.kirupa.com/t/a-couple-of-problems-gotoandplay-with-stop/4477>\
**Category:** flash\
**Created:** [August 11, 2002, 6:35am UTC](https://forum.kirupa.com/t/a-couple-of-problems-gotoandplay-with-stop/4477 "2002-08-11T06:35:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeonGold](https://avatars.discourse-cdn.com/v4/letter/n/e5b9ba/32.png) [@NeonGold](https://forum.kirupa.com/u/NeonGold)\
**Post date:** [August 11, 2002, 6:35am UTC](https://forum.kirupa.com/t/a-couple-of-problems-gotoandplay-with-stop/4477/1 "2002-08-11T06:35:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 11, 2002, 7:20am UTC](https://forum.kirupa.com/t/a-couple-of-problems-gotoandplay-with-stop/4477/2 "2002-08-11T07:20:52Z")

</div>

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 &gt; 30)
{ 
  gtout=30;
 if (attpow1 &gt; 0 &lt; 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);  
}  
}

}
