Using Macromedia Flash MX version 6.0
I never did buttons before. Bear with me if I sound ignorant.
I'm an artist/photographer and trying to use flash in a
project of portraits I'm working on.
I've been trying to get an invisible button to start and stop
on click both the picture and the sound on a 20 second animated swf

I created the invisible button - which
encompasses the whole screen from directions I found online:
http://www.tutorial5.com/content/view/107/46/

I then used an action code to click start and stop that I found on this very forum from 2002 (!)

http://board.flashkit.com/board/showthread.php?t=528987

I used the following code from the above post:


Or you can keep the invisible button and place the following code in the first frame on the main timeline

code:

var isStopped;

function stopAll(j) {

var i = 0;

for (i in j) {

if (typeof (j) == "movieclip") {

j.stop();

if (j != j) {

stopAll(j);

}

}

}

isStopped = true;

}

function startAll(j) {

var i = 0;

for (i in j) {

if (typeof (j) == "movieclip") {

j.play();

if (j != j) {

startAll(j);

}

}

}

isStopped = false;

}

myButton_bn.onPress = function() {

if (isStopped) {

startAll(_level0);

} else if (!isStopped) {

stopAll(_level0);

}

};

myButton_bn.useHandCursor = false;
When I publish the file the output box reads:
Scene=Scene 1, Layer=Button, Frame=1: Line 1: Statement must appear within on handler
var isStopped;

Scene=Scene 1, Layer=Button, Frame=1: Line 2: Statement must appear within on handler
function stopAll(j) {

Scene=Scene 1, Layer=Button, Frame=1: Line 14: Statement must appear within on handler
function startAll(j) {

Scene=Scene 1, Layer=Button, Frame=1: Line 26: Statement must appear within on handler
invisibleButton_bn.onPress = function() {

Scene=Scene 1, Layer=Button, Frame=1: Line 33: Statement must appear within on handler
invisibleButton_bn.useHandCursor = false;
The animation and music play but of course there is no response to my clicking away.
I've been working on this for the past three days and really can't figure out where I've gone wrong.
I'd so appreciate any suggestions to try and achieve this task. To be able to mouse click anywhere on the stage/screen and have the music and picture stop and then when clicked again have it start in the same place it was stopped.
I can send the FLA file if that would help in figuring out what I am doing wrong. It's very small.
Thanks for your time....