Skip to main content
Participating Frequently
January 6, 2013
Question

My document plays as a continous loop even with the stop(); code at the start of the document HELP!

  • January 6, 2013
  • 2 replies
  • 1531 views

I really need help for a school project im working on, it seems as though flash doesnt even recognise the actions in the layers, the codes in the first frame are as follows:

stop();

/* Click to Go to Frame and Stop

Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.

Can be used on the main timeline or on movie clip timelines.

Instructions:

1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.

*/

btnOS.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame);

function fl_ClickToGoToAndStopAtFrame(event:MouseEvent):void

{

    gotoAndStop(8);

}

/* Click to Go to Frame and Stop

Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.

Can be used on the main timeline or on movie clip timelines.

Instructions:

1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.

*/

btnia.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_2);

function fl_ClickToGoToAndStopAtFrame_2(event:MouseEvent):void

{

    gotoAndStop(41);

}

/* Click to Go to Frame and Stop

Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.

Can be used on the main timeline or on movie clip timelines.

Instructions:

1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.

*/

btnDD.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_3);

function fl_ClickToGoToAndStopAtFrame_3(event:MouseEvent):void

{

    gotoAndStop(64);

}

/* Click to Go to Frame and Stop

Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.

Can be used on the main timeline or on movie clip timelines.

Instructions:

1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.

*/

btnCA.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_4);

function fl_ClickToGoToAndStopAtFrame_4(event:MouseEvent):void

{

    gotoAndStop(2);

}

/* Click to Go to Frame and Stop

Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.

Can be used on the main timeline or on movie clip timelines.

Instructions:

1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.

*/

btnSpt.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_5);

function fl_ClickToGoToAndStopAtFrame_5(event:MouseEvent):void

{

    gotoAndStop(3);

}

/* Click to Go to Frame and Stop

Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.

Can be used on the main timeline or on movie clip timelines.

Instructions:

1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.

*/

btnent3.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_6);

function fl_ClickToGoToAndStopAtFrame_6(event:MouseEvent):void

{

    gotoAndStop(4);

}

/* Click to Go to Frame and Stop

Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.

Can be used on the main timeline or on movie clip timelines.

Instructions:

1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.

*/

btntvf.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_7);

function fl_ClickToGoToAndStopAtFrame_7(event:MouseEvent):void

{

    gotoAndStop(5);

}

/* Click to Go to Frame and Stop

Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.

Can be used on the main timeline or on movie clip timelines.

Instructions:

1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.

*/

btnmus.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_8);

function fl_ClickToGoToAndStopAtFrame_8(event:MouseEvent):void

{

    gotoAndStop(6);

}

/* Click to Go to Frame and Stop

Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.

Can be used on the main timeline or on movie clip timelines.

Instructions:

1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.

*/

btntrans.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_9);

function fl_ClickToGoToAndStopAtFrame_9(event:MouseEvent):void

{

    gotoAndStop(7);

}

/* Click to Go to Frame and Stop

Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.

Can be used on the main timeline or on movie clip timelines.

Instructions:

1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.

*/

btnHome.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_10);

function fl_ClickToGoToAndStopAtFrame_10(event:MouseEvent):void

{

    gotoAndStop(1);

}

Surely this should stop the document from looping when tested, when testing the images and buttons ect seem to be distorted and in different positions.

if it helps here is a download of the document:

http://www.sendspace.com/file/oxqciv

This topic has been closed for replies.

2 replies

Ned Murphy
Legend
January 6, 2013

Are you getting any error messages?

Some helpful advice...

1) You should remove all of the directions that using script assist adds to your code.  It becomes very hard to read when so much of it is just commentary repeating over and over.

2)  If you want to make files available, some people are willing to take a look, other are not and for good reasons... try to find a better service than one where you cannot tell which will be downloading your files versus whatever else they are trying to lure you into.  If you visit the link you provided you can probably see why I am not going to chance selecting any one of the various download buttons that appear.

DGaspoAuthor
Participating Frequently
January 6, 2013
sinious
Legend
January 6, 2013

Chances are you're not paying attention to errors. Any scripting errors will disable scripting and your stop() will be ignored until you fix them all. Can you verify you have no errors when testing?

DGaspoAuthor
Participating Frequently
January 6, 2013

There doesn't seem to be any errors apart from a syntax error which occured after i placed an mp3 player component into the document but this was after the document looped

sinious
Legend
January 6, 2013

If there are any syntax errors it will neglect your code. You must resolve the syntax error.

It's telling you there's extra characters, e.g.:

mcPlayer.init(componentWidth, componentHeight, pathToFiles, xmlPath, songURL, artistName, songName);}

You should not have that brace at the end of that line. It's not inside a function or have any valid starting brace. Remove the braces.

e.g.

mcPlayer.init(componentWidth, componentHeight, pathToFiles, xmlPath, songURL, artistName, songName);