I’ve been using Adobe Flash CS4 for a couple of days. I’ve drawn a worm, with eyes and a mouth and these pieces are all MovieClip symbols. I have exported them to actionscript with the class name being the same as what they are (ie. the mouth MovieClip is exported as mouth). The mouth has 2 frames, one smiling and one frowning. I need to mouth to stay smiling at first, so in Frame 1 actions I wrote:
mouth.gotoAndStop(1);
But I get this compiler error:
1061: Call to a possibly undefined method gotoAndStop through a reference with static type Class.
Why is this occuring? Thanks.
You need to give your Movieclip an instance name in order to reference it by code (if you don´t use stop() inside the mouth clip). Select your Movieclip and give it an instance name in the properties window. If you have nested your mouth instance and want to control it from the main timeline/class you should also declare the full body of the snake.