Basic button to play movie AS question - please help

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…

on (press){
_root.gotoAndPlay(2);
}

on (press){
_root.gotoAndStop(15);
}

on (press) {
(playing=!playing) ? stop() : play();
}

you can use gotoAndStop(whatever) instead of stop()
and gotoAndPlay(whatever) instaed of play() if needed

Thank you.
Even dumber question (told you I was hopeless at this!) Do I add this code to the movie timeline or the movie in the main timeline or do I add it to the button timeline or the button in the main timeline? (as you can see I’m completely clueless!) also for the button - do i need two frames in the main timeline one for play and one for stop?

Ok - just to say that I worked it out!!! thank you so much for your help.

Glad you worked it out