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:
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.
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.