# Unresponsive 'gotoAndStop' command

**URL:** <https://forum.kirupa.com/t/unresponsive-gotoandstop-command/292840>\
**Category:** flash\
**Created:** [July 20, 2009, 10:31am UTC](https://forum.kirupa.com/t/unresponsive-gotoandstop-command/292840 "2009-07-20T10:31:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wurzagg](https://avatars.discourse-cdn.com/v4/letter/w/50afbb/32.png) [@Wurzagg](https://forum.kirupa.com/u/Wurzagg)\
**Post date:** [July 20, 2009, 10:31am UTC](https://forum.kirupa.com/t/unresponsive-gotoandstop-command/292840/1 "2009-07-20T10:31:17Z")

</div>

I’m working on this simple arcade game with powerups. When a powerup is hit, it does something to the player/enemy controlled mc. Among other things it should set the player/enemy mc to a different frame to change its shape. But for some reason the gotoAndStop call doesn’t respond inside the function.

It does work in the main code, where I use it to stop on the first frame when the swf starts.  
I can also give another command to the mc in the function, which works properly. I’ve tested:

```auto
caller.y += 10; 

```

Below is the start of the function I wrote. It continues and closes properly. No compile errors are found. ‘caller’ refers to the player/enemy mc’s, whichever owns the hit. ‘target’ refers to the powerup hit. Powerup is a class (extended from Sprite), which has the int property ‘power’, referring to what it will do when hit.

```auto
function applyPower(caller:MovieClip, target:Powerup)
{
    trace(caller.name+", "+target.power);
    switch(target.power)
    {
        case 0://long paddle
        caller.gotoAndStop("long");
        break;
        case 1://narrow paddle
        caller.gotoAndStop("narrow");
        break;
        case 2://split paddle
        caller.gotoAndStop("split");
        break;
etc.

```
