I’m trying (and failing it seems) to teach myself Action script and I’m having a really tough time with what I’m sure is something that quite easy to do.
Basically I have one button. When this button is pressed I’d like it play a movie. When the button is pressed again I’d like to stop playing the movie.
In the first frame of the movie I’ve put a stop action so that it doesn;t repeat itself when it finishes playing. In the last frame of the movie I’ve put gotoAndStop(2);
In my main timeline I have 2 layers each of which has one frame. The button is one layer and the movie on the other.
I selected the button on the stage and gave it the actionscript
on (press){
gotoAndPlay(“vcsound_mc.play(2)”);
}
I then selected the movie clip and added the action script:
this.vcsound_mc.onPress = function() {
play();
};
trace(“frame 2”);
When I checked the syntax in Flash it said there were no errors. But when I test the movie it doesn’t work.
All you clever flash people out there will probably be howling at this infantile attempt at actionscript but please remeber what it was like the first time you struggled with actionscript…I’ve read so many tutorials now that I’m completely confused…