Skip navigation
Currently Being Moderated

Where is the setting in the .FLA to return the playhead to the start in the SWF?

Feb 18, 2013 9:08 AM

Tags: #as3 #action_script_3 #flash_cs5.5

Hello,

 

I have a simple three-button slideshow using separate stop, play, and go-to-start buttons. There is an audio track that plays as the slides fade in over each other on separate layers. The AS3 code in Frame 1 is:

 

stop();

 

stopBtn.addEventListener(MouseEvent.CLICK, onStopClick,

                         false, 0, true);

function onStopClick(evt:MouseEvent):void {

    stop();

}

playBtn.addEventListener(MouseEvent.CLICK, onPlayClick,

                         false, 0, true);

function onPlayClick(evt:MouseEvent):void {

    play();

}

gotoStopBtn.addEventListener(MouseEvent.CLICK, onGotoStopClick,

                             false, 0, true);

function onGotoStopClick(evt:MouseEvent):void {

    gotoAndStop(1);

}

 

When the SWF slideshow reaches the last frame it automatically goes back to the start. That is fine and is what I want for the current projects, but I want to understand why it does that. Is there a setting somewhere in the .FLA project where the behavior of the playhead at the last frame is set?

 

Thanks

 
Replies
  • Currently Being Moderated
    Feb 18, 2013 9:12 AM   in reply to tomwood2

    If you want something to stop at a frame you need to commands to that end.  A stop() command in the frame will do it and a gotoAndStop() command will do it, as will a nextFrame() command.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 18, 2013 10:57 AM   in reply to tomwood2

    That's what it does normally.  You need to tell it to stop at the end using code if you want it to be so.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points