1 2 Previous Next 51 Replies Latest reply on Oct 2, 2006 12:54 PM by kenewing

    Embedding a series of stop points in a timeline

    kenewing
      I have Flash 8 running on Windows XP. I’m just learning to use it. I’ve been through the training from Total Training and I’ve completed a successful project. Now I want to do something more with the project and I don’t know how to proceed.

      I want to embed a series of checkpoints in the timeline. Then I want to create a button called “Step” that, when clicked, will play the movie up to the next checkpoint, then stop. Click “Step” again and you resume the movie at that point and stop at the next checkpoint. This will let me step through the movie and have it pause it at predetermined points.

      Thanks for any input.
        • 1. Re: Embedding a series of stop points in a timeline
          Level 7
          kenewing,

          > I want to embed a series of checkpoints in the timeline.
          > Then I want to create a button called ?Step? that, when
          > clicked, will play the movie up to the next checkpoint,
          > then stop.

          Sounds like you may want to put a frame script at each of these
          checkpoints that simply says stop();. Have your button tell the main
          timeline to play(); -- that should do it. The main timeline is a movie
          clip, like any movie clip symbol, so it will continue to play until told to
          stop.

          Does that make sense?


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. Re: Embedding a series of stop points in a timeline
            kenewing Level 1
            This works partially. I can embed a stop() at each checkpoint in the timeline, then attach a play() script to the Step button. I can then step through the timeline as desired. The problem is that the Flash file becomes either/or rather than both/and. I can set up the movie to play continuously, OR set it up to step manually, but I can't do both.

            Ideally, I want to have two buttons: one that plays the whole timeline without pauses, and a different one that lets me step through the timeline manually.

            Further ideas?
            • 3. Re: Embedding a series of stop points in a timeline
              kenewing Level 1
              Addendum: What I imagine doing is putting some kind of marker at selected frames, then scripting the Step button to do something like "play until (marker), then stop." But I don't know if such a thing can be done in Flash.
              • 4. Re: Embedding a series of stop points in a timeline
                Level 7
                kenewing,

                > This works partially. I can embed a stop() at each
                > checkpoint in the timeline, then attach a play() script
                > to the Step button. I can then step through the
                > timeline as desired.

                I'm with ya.

                > The problem is that the Flash file becomes either/or
                > rather than both/and. I can set up the movie to play
                > continuously, OR set it up to step manually, but I
                > can't do both.

                Sure you can. :)

                > Ideally, I want to have two buttons: one that plays the
                > whole timeline without pauses, and a different one that
                > lets me step through the timeline manually.

                Okay, sounds like a good use for a variable.

                > Further ideas?

                Create a variable in frame 1.

                var doPausing:Boolean = false;

                Then check that variable in later frames to see if you should do the
                pausing or not. For example, where you might currently have a stop() action
                on frame 20, change it to this ...

                if (doPausing == true) {
                stop();
                }

                Or, shorthand ...

                if (doPausing) {
                stop();
                }

                It just means that the main timeline will only obey the stop() if that
                variable's value is true. Use your buttons to set it true or false.

                // Play button
                btnPlay.onRelease = function() {
                doPausing = false;
                gotoAndPlay( whatever frame to start on );
                }

                // Play with pauses
                btnPlayWithPauses.onRelease = function() {
                doPausing = true;
                gotoAndPlay( whatever frame to start on );
                }


                David Stiller
                Adobe Community Expert
                Dev blog, http://www.quip.net/blog/
                "Luck is the residue of good design."


                • 5. Re: Embedding a series of stop points in a timeline
                  kenewing Level 1
                  All makes sense. I inserted the action scripts as suggested adapting all the names to suit. When I generate the swf file, I get the following two error messages:

                  **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1: Statement must appear within on handler
                  btnPlay.onRelease = function() {

                  **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1: Statement must appear within on handler
                  btnStep.onRelease = function() {

                  I admit that I'm inexperienced in programming. Can you discern from this where the error comes from?
                  • 6. Re: Embedding a series of stop points in a timeline
                    Level 7
                    kenewing,

                    > All makes sense.

                    Cool.

                    > I inserted the action scripts as suggested adapting all
                    > the names to suit. When I generate the swf file, I get
                    > the following two error messages:
                    >
                    > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                    > Statement must appear within on handler
                    > btnPlay.onRelease = function() {
                    >

                    That means you're pasting the code directly on the button, rather than
                    in the main timeline. If you're pasting directly to the button, you need to
                    put your code within an on() or onClipEvent() handler. That's how things
                    were done back in Flash 5, but the current best practices recommendation is
                    that you put your code in a layer of the main timeline. That's the reason
                    for instance names on your movie clips: the code sits in a timeline and
                    calls the desired clips by name. When code is in an on() handler, it's
                    directly attached, so instance names aren't necessary.

                    Here are some thoughts on the matter.

                    http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                    David Stiller
                    Adobe Community Expert
                    Dev blog, http://www.quip.net/blog/
                    "Luck is the residue of good design."


                    • 7. Re: Embedding a series of stop points in a timeline
                      Level 7
                      kenewing,

                      > All makes sense.

                      Cool.

                      > I inserted the action scripts as suggested adapting all
                      > the names to suit. When I generate the swf file, I get
                      > the following two error messages:
                      >
                      > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                      > Statement must appear within on handler
                      > btnPlay.onRelease = function() {
                      >

                      That means you're pasting the code directly on the button, rather than
                      in the main timeline. If you're pasting directly to the button, you need to
                      put your code within an on() or onClipEvent() handler. That's how things
                      were done back in Flash 5, but the current best practices recommendation is
                      that you put your code in a layer of the main timeline. That's the reason
                      for instance names on your movie clips: the code sits in a timeline and
                      calls the desired clips by name. When code is in an on() handler, it's
                      directly attached, so instance names aren't necessary.

                      Here are some thoughts on the matter.

                      http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                      David Stiller
                      Adobe Community Expert
                      Dev blog, http://www.quip.net/blog/
                      "Luck is the residue of good design."


                      • 8. Re: Embedding a series of stop points in a timeline
                        Level 7
                        kenewing,

                        > All makes sense.

                        Cool.

                        > I inserted the action scripts as suggested adapting all
                        > the names to suit. When I generate the swf file, I get
                        > the following two error messages:
                        >
                        > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                        > Statement must appear within on handler
                        > btnPlay.onRelease = function() {
                        >

                        That means you're pasting the code directly on the button, rather than
                        in the main timeline. If you're pasting directly to the button, you need to
                        put your code within an on() or onClipEvent() handler. That's how things
                        were done back in Flash 5, but the current best practices recommendation is
                        that you put your code in a layer of the main timeline. That's the reason
                        for instance names on your movie clips: the code sits in a timeline and
                        calls the desired clips by name. When code is in an on() handler, it's
                        directly attached, so instance names aren't necessary.

                        Here are some thoughts on the matter.

                        http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                        David Stiller
                        Adobe Community Expert
                        Dev blog, http://www.quip.net/blog/
                        "Luck is the residue of good design."


                        • 9. Re: Embedding a series of stop points in a timeline
                          Level 7
                          kenewing,

                          > All makes sense.

                          Cool.

                          > I inserted the action scripts as suggested adapting all
                          > the names to suit. When I generate the swf file, I get
                          > the following two error messages:
                          >
                          > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                          > Statement must appear within on handler
                          > btnPlay.onRelease = function() {
                          >

                          That means you're pasting the code directly on the button, rather than
                          in the main timeline. If you're pasting directly to the button, you need to
                          put your code within an on() or onClipEvent() handler. That's how things
                          were done back in Flash 5, but the current best practices recommendation is
                          that you put your code in a layer of the main timeline. That's the reason
                          for instance names on your movie clips: the code sits in a timeline and
                          calls the desired clips by name. When code is in an on() handler, it's
                          directly attached, so instance names aren't necessary.

                          Here are some thoughts on the matter.

                          http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                          David Stiller
                          Adobe Community Expert
                          Dev blog, http://www.quip.net/blog/
                          "Luck is the residue of good design."


                          • 10. Re: Embedding a series of stop points in a timeline
                            kenewing Level 1
                            OK, I think we're homing in on it. I think I've got things working except for the Step function. I moved the scripts from the button to the frame as you suggested. But the Step button doesn't work yet. Below is the relevant code in that ActionScript window. In frame 1:

                            var doPausing:Boolean = false;
                            btnStep.onRelease = function() {
                            doPausing = true;
                            gotoAndPlay( startFrame );
                            }

                            At each pause point in the timeline I have the following lines embedded in a frame:

                            if (doPausing == true) {
                            stop();
                            }

                            Here's the tripwire: how do I enter a relative value for startFrame in frame 1? After each pause, I need the Step button to execute a play() starting with the next frame in the timeline.

                            Make sense? Thanks for all the help so far.
                            • 11. Re: Embedding a series of stop points in a timeline
                              Level 7
                              kenewing,

                              > All makes sense.

                              Cool.

                              > I inserted the action scripts as suggested adapting all
                              > the names to suit. When I generate the swf file, I get
                              > the following two error messages:
                              >
                              > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                              > Statement must appear within on handler
                              > btnPlay.onRelease = function() {
                              >

                              That means you're pasting the code directly on the button, rather than
                              in the main timeline. If you're pasting directly to the button, you need to
                              put your code within an on() or onClipEvent() handler. That's how things
                              were done back in Flash 5, but the current best practices recommendation is
                              that you put your code in a layer of the main timeline. That's the reason
                              for instance names on your movie clips: the code sits in a timeline and
                              calls the desired clips by name. When code is in an on() handler, it's
                              directly attached, so instance names aren't necessary.

                              Here are some thoughts on the matter.

                              http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                              David Stiller
                              Adobe Community Expert
                              Dev blog, http://www.quip.net/blog/
                              "Luck is the residue of good design."


                              • 12. Re: Embedding a series of stop points in a timeline
                                Level 7
                                kenewing,

                                > All makes sense.

                                Cool.

                                > I inserted the action scripts as suggested adapting all
                                > the names to suit. When I generate the swf file, I get
                                > the following two error messages:
                                >
                                > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                > Statement must appear within on handler
                                > btnPlay.onRelease = function() {
                                >

                                That means you're pasting the code directly on the button, rather than
                                in the main timeline. If you're pasting directly to the button, you need to
                                put your code within an on() or onClipEvent() handler. That's how things
                                were done back in Flash 5, but the current best practices recommendation is
                                that you put your code in a layer of the main timeline. That's the reason
                                for instance names on your movie clips: the code sits in a timeline and
                                calls the desired clips by name. When code is in an on() handler, it's
                                directly attached, so instance names aren't necessary.

                                Here are some thoughts on the matter.

                                http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                David Stiller
                                Adobe Community Expert
                                Dev blog, http://www.quip.net/blog/
                                "Luck is the residue of good design."


                                • 13. Re: Embedding a series of stop points in a timeline
                                  Level 7
                                  kenewing,

                                  > All makes sense.

                                  Cool.

                                  > I inserted the action scripts as suggested adapting all
                                  > the names to suit. When I generate the swf file, I get
                                  > the following two error messages:
                                  >
                                  > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                  > Statement must appear within on handler
                                  > btnPlay.onRelease = function() {
                                  >

                                  That means you're pasting the code directly on the button, rather than
                                  in the main timeline. If you're pasting directly to the button, you need to
                                  put your code within an on() or onClipEvent() handler. That's how things
                                  were done back in Flash 5, but the current best practices recommendation is
                                  that you put your code in a layer of the main timeline. That's the reason
                                  for instance names on your movie clips: the code sits in a timeline and
                                  calls the desired clips by name. When code is in an on() handler, it's
                                  directly attached, so instance names aren't necessary.

                                  Here are some thoughts on the matter.

                                  http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                  David Stiller
                                  Adobe Community Expert
                                  Dev blog, http://www.quip.net/blog/
                                  "Luck is the residue of good design."


                                  • 14. Re: Embedding a series of stop points in a timeline
                                    Level 7
                                    kenewing,

                                    > All makes sense.

                                    Cool.

                                    > I inserted the action scripts as suggested adapting all
                                    > the names to suit. When I generate the swf file, I get
                                    > the following two error messages:
                                    >
                                    > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                    > Statement must appear within on handler
                                    > btnPlay.onRelease = function() {
                                    >

                                    That means you're pasting the code directly on the button, rather than
                                    in the main timeline. If you're pasting directly to the button, you need to
                                    put your code within an on() or onClipEvent() handler. That's how things
                                    were done back in Flash 5, but the current best practices recommendation is
                                    that you put your code in a layer of the main timeline. That's the reason
                                    for instance names on your movie clips: the code sits in a timeline and
                                    calls the desired clips by name. When code is in an on() handler, it's
                                    directly attached, so instance names aren't necessary.

                                    Here are some thoughts on the matter.

                                    http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                    David Stiller
                                    Adobe Community Expert
                                    Dev blog, http://www.quip.net/blog/
                                    "Luck is the residue of good design."


                                    • 15. Re: Embedding a series of stop points in a timeline
                                      Level 7
                                      kenewing,

                                      > All makes sense.

                                      Cool.

                                      > I inserted the action scripts as suggested adapting all
                                      > the names to suit. When I generate the swf file, I get
                                      > the following two error messages:
                                      >
                                      > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                      > Statement must appear within on handler
                                      > btnPlay.onRelease = function() {
                                      >

                                      That means you're pasting the code directly on the button, rather than
                                      in the main timeline. If you're pasting directly to the button, you need to
                                      put your code within an on() or onClipEvent() handler. That's how things
                                      were done back in Flash 5, but the current best practices recommendation is
                                      that you put your code in a layer of the main timeline. That's the reason
                                      for instance names on your movie clips: the code sits in a timeline and
                                      calls the desired clips by name. When code is in an on() handler, it's
                                      directly attached, so instance names aren't necessary.

                                      Here are some thoughts on the matter.

                                      http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                      David Stiller
                                      Adobe Community Expert
                                      Dev blog, http://www.quip.net/blog/
                                      "Luck is the residue of good design."


                                      • 16. Re: Embedding a series of stop points in a timeline
                                        Level 7
                                        kenewing,

                                        > All makes sense.

                                        Cool.

                                        > I inserted the action scripts as suggested adapting all
                                        > the names to suit. When I generate the swf file, I get
                                        > the following two error messages:
                                        >
                                        > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                        > Statement must appear within on handler
                                        > btnPlay.onRelease = function() {
                                        >

                                        That means you're pasting the code directly on the button, rather than
                                        in the main timeline. If you're pasting directly to the button, you need to
                                        put your code within an on() or onClipEvent() handler. That's how things
                                        were done back in Flash 5, but the current best practices recommendation is
                                        that you put your code in a layer of the main timeline. That's the reason
                                        for instance names on your movie clips: the code sits in a timeline and
                                        calls the desired clips by name. When code is in an on() handler, it's
                                        directly attached, so instance names aren't necessary.

                                        Here are some thoughts on the matter.

                                        http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                        David Stiller
                                        Adobe Community Expert
                                        Dev blog, http://www.quip.net/blog/
                                        "Luck is the residue of good design."


                                        • 17. Re: Embedding a series of stop points in a timeline
                                          Level 7
                                          kenewing,

                                          > All makes sense.

                                          Cool.

                                          > I inserted the action scripts as suggested adapting all
                                          > the names to suit. When I generate the swf file, I get
                                          > the following two error messages:
                                          >
                                          > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                          > Statement must appear within on handler
                                          > btnPlay.onRelease = function() {
                                          >

                                          That means you're pasting the code directly on the button, rather than
                                          in the main timeline. If you're pasting directly to the button, you need to
                                          put your code within an on() or onClipEvent() handler. That's how things
                                          were done back in Flash 5, but the current best practices recommendation is
                                          that you put your code in a layer of the main timeline. That's the reason
                                          for instance names on your movie clips: the code sits in a timeline and
                                          calls the desired clips by name. When code is in an on() handler, it's
                                          directly attached, so instance names aren't necessary.

                                          Here are some thoughts on the matter.

                                          http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                          David Stiller
                                          Adobe Community Expert
                                          Dev blog, http://www.quip.net/blog/
                                          "Luck is the residue of good design."


                                          • 18. Re: Embedding a series of stop points in a timeline
                                            Level 7
                                            kenewing,

                                            > All makes sense.

                                            Cool.

                                            > I inserted the action scripts as suggested adapting all
                                            > the names to suit. When I generate the swf file, I get
                                            > the following two error messages:
                                            >
                                            > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                            > Statement must appear within on handler
                                            > btnPlay.onRelease = function() {
                                            >

                                            That means you're pasting the code directly on the button, rather than
                                            in the main timeline. If you're pasting directly to the button, you need to
                                            put your code within an on() or onClipEvent() handler. That's how things
                                            were done back in Flash 5, but the current best practices recommendation is
                                            that you put your code in a layer of the main timeline. That's the reason
                                            for instance names on your movie clips: the code sits in a timeline and
                                            calls the desired clips by name. When code is in an on() handler, it's
                                            directly attached, so instance names aren't necessary.

                                            Here are some thoughts on the matter.

                                            http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                            David Stiller
                                            Adobe Community Expert
                                            Dev blog, http://www.quip.net/blog/
                                            "Luck is the residue of good design."


                                            • 19. Re: Embedding a series of stop points in a timeline
                                              Level 7
                                              kenewing,

                                              > All makes sense.

                                              Cool.

                                              > I inserted the action scripts as suggested adapting all
                                              > the names to suit. When I generate the swf file, I get
                                              > the following two error messages:
                                              >
                                              > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                              > Statement must appear within on handler
                                              > btnPlay.onRelease = function() {
                                              >

                                              That means you're pasting the code directly on the button, rather than
                                              in the main timeline. If you're pasting directly to the button, you need to
                                              put your code within an on() or onClipEvent() handler. That's how things
                                              were done back in Flash 5, but the current best practices recommendation is
                                              that you put your code in a layer of the main timeline. That's the reason
                                              for instance names on your movie clips: the code sits in a timeline and
                                              calls the desired clips by name. When code is in an on() handler, it's
                                              directly attached, so instance names aren't necessary.

                                              Here are some thoughts on the matter.

                                              http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                              David Stiller
                                              Adobe Community Expert
                                              Dev blog, http://www.quip.net/blog/
                                              "Luck is the residue of good design."


                                              • 20. Re: Embedding a series of stop points in a timeline
                                                Level 7
                                                kenewing,

                                                > All makes sense.

                                                Cool.

                                                > I inserted the action scripts as suggested adapting all
                                                > the names to suit. When I generate the swf file, I get
                                                > the following two error messages:
                                                >
                                                > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                                > Statement must appear within on handler
                                                > btnPlay.onRelease = function() {
                                                >

                                                That means you're pasting the code directly on the button, rather than
                                                in the main timeline. If you're pasting directly to the button, you need to
                                                put your code within an on() or onClipEvent() handler. That's how things
                                                were done back in Flash 5, but the current best practices recommendation is
                                                that you put your code in a layer of the main timeline. That's the reason
                                                for instance names on your movie clips: the code sits in a timeline and
                                                calls the desired clips by name. When code is in an on() handler, it's
                                                directly attached, so instance names aren't necessary.

                                                Here are some thoughts on the matter.

                                                http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                                David Stiller
                                                Adobe Community Expert
                                                Dev blog, http://www.quip.net/blog/
                                                "Luck is the residue of good design."


                                                • 21. Re: Embedding a series of stop points in a timeline
                                                  Level 7
                                                  kenewing,

                                                  > All makes sense.

                                                  Cool.

                                                  > I inserted the action scripts as suggested adapting all
                                                  > the names to suit. When I generate the swf file, I get
                                                  > the following two error messages:
                                                  >
                                                  > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                                  > Statement must appear within on handler
                                                  > btnPlay.onRelease = function() {
                                                  >

                                                  That means you're pasting the code directly on the button, rather than
                                                  in the main timeline. If you're pasting directly to the button, you need to
                                                  put your code within an on() or onClipEvent() handler. That's how things
                                                  were done back in Flash 5, but the current best practices recommendation is
                                                  that you put your code in a layer of the main timeline. That's the reason
                                                  for instance names on your movie clips: the code sits in a timeline and
                                                  calls the desired clips by name. When code is in an on() handler, it's
                                                  directly attached, so instance names aren't necessary.

                                                  Here are some thoughts on the matter.

                                                  http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                                  David Stiller
                                                  Adobe Community Expert
                                                  Dev blog, http://www.quip.net/blog/
                                                  "Luck is the residue of good design."


                                                  • 22. Re: Embedding a series of stop points in a timeline
                                                    Level 7
                                                    kenewing,

                                                    > All makes sense.

                                                    Cool.

                                                    > I inserted the action scripts as suggested adapting all
                                                    > the names to suit. When I generate the swf file, I get
                                                    > the following two error messages:
                                                    >
                                                    > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                                    > Statement must appear within on handler
                                                    > btnPlay.onRelease = function() {
                                                    >

                                                    That means you're pasting the code directly on the button, rather than
                                                    in the main timeline. If you're pasting directly to the button, you need to
                                                    put your code within an on() or onClipEvent() handler. That's how things
                                                    were done back in Flash 5, but the current best practices recommendation is
                                                    that you put your code in a layer of the main timeline. That's the reason
                                                    for instance names on your movie clips: the code sits in a timeline and
                                                    calls the desired clips by name. When code is in an on() handler, it's
                                                    directly attached, so instance names aren't necessary.

                                                    Here are some thoughts on the matter.

                                                    http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                                    David Stiller
                                                    Adobe Community Expert
                                                    Dev blog, http://www.quip.net/blog/
                                                    "Luck is the residue of good design."


                                                    • 23. Re: Embedding a series of stop points in a timeline
                                                      Level 7
                                                      kenewing,

                                                      > All makes sense.

                                                      Cool.

                                                      > I inserted the action scripts as suggested adapting all
                                                      > the names to suit. When I generate the swf file, I get
                                                      > the following two error messages:
                                                      >
                                                      > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                                      > Statement must appear within on handler
                                                      > btnPlay.onRelease = function() {
                                                      >

                                                      That means you're pasting the code directly on the button, rather than
                                                      in the main timeline. If you're pasting directly to the button, you need to
                                                      put your code within an on() or onClipEvent() handler. That's how things
                                                      were done back in Flash 5, but the current best practices recommendation is
                                                      that you put your code in a layer of the main timeline. That's the reason
                                                      for instance names on your movie clips: the code sits in a timeline and
                                                      calls the desired clips by name. When code is in an on() handler, it's
                                                      directly attached, so instance names aren't necessary.

                                                      Here are some thoughts on the matter.

                                                      http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                                      David Stiller
                                                      Adobe Community Expert
                                                      Dev blog, http://www.quip.net/blog/
                                                      "Luck is the residue of good design."


                                                      • 24. Re: Embedding a series of stop points in a timeline
                                                        Level 7
                                                        kenewing,

                                                        > All makes sense.

                                                        Cool.

                                                        > I inserted the action scripts as suggested adapting all
                                                        > the names to suit. When I generate the swf file, I get
                                                        > the following two error messages:
                                                        >
                                                        > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                                        > Statement must appear within on handler
                                                        > btnPlay.onRelease = function() {
                                                        >

                                                        That means you're pasting the code directly on the button, rather than
                                                        in the main timeline. If you're pasting directly to the button, you need to
                                                        put your code within an on() or onClipEvent() handler. That's how things
                                                        were done back in Flash 5, but the current best practices recommendation is
                                                        that you put your code in a layer of the main timeline. That's the reason
                                                        for instance names on your movie clips: the code sits in a timeline and
                                                        calls the desired clips by name. When code is in an on() handler, it's
                                                        directly attached, so instance names aren't necessary.

                                                        Here are some thoughts on the matter.

                                                        http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                                        David Stiller
                                                        Adobe Community Expert
                                                        Dev blog, http://www.quip.net/blog/
                                                        "Luck is the residue of good design."


                                                        • 25. Re: Embedding a series of stop points in a timeline
                                                          Level 7
                                                          kenewing,

                                                          > All makes sense.

                                                          Cool.

                                                          > I inserted the action scripts as suggested adapting all
                                                          > the names to suit. When I generate the swf file, I get
                                                          > the following two error messages:
                                                          >
                                                          > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                                          > Statement must appear within on handler
                                                          > btnPlay.onRelease = function() {
                                                          >

                                                          That means you're pasting the code directly on the button, rather than
                                                          in the main timeline. If you're pasting directly to the button, you need to
                                                          put your code within an on() or onClipEvent() handler. That's how things
                                                          were done back in Flash 5, but the current best practices recommendation is
                                                          that you put your code in a layer of the main timeline. That's the reason
                                                          for instance names on your movie clips: the code sits in a timeline and
                                                          calls the desired clips by name. When code is in an on() handler, it's
                                                          directly attached, so instance names aren't necessary.

                                                          Here are some thoughts on the matter.

                                                          http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                                          David Stiller
                                                          Adobe Community Expert
                                                          Dev blog, http://www.quip.net/blog/
                                                          "Luck is the residue of good design."


                                                          • 26. Re: Embedding a series of stop points in a timeline
                                                            Level 7
                                                            kenewing,

                                                            > All makes sense.

                                                            Cool.

                                                            > I inserted the action scripts as suggested adapting all
                                                            > the names to suit. When I generate the swf file, I get
                                                            > the following two error messages:
                                                            >
                                                            > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                                            > Statement must appear within on handler
                                                            > btnPlay.onRelease = function() {
                                                            >

                                                            That means you're pasting the code directly on the button, rather than
                                                            in the main timeline. If you're pasting directly to the button, you need to
                                                            put your code within an on() or onClipEvent() handler. That's how things
                                                            were done back in Flash 5, but the current best practices recommendation is
                                                            that you put your code in a layer of the main timeline. That's the reason
                                                            for instance names on your movie clips: the code sits in a timeline and
                                                            calls the desired clips by name. When code is in an on() handler, it's
                                                            directly attached, so instance names aren't necessary.

                                                            Here are some thoughts on the matter.

                                                            http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                                            David Stiller
                                                            Adobe Community Expert
                                                            Dev blog, http://www.quip.net/blog/
                                                            "Luck is the residue of good design."


                                                            • 27. Re: Embedding a series of stop points in a timeline
                                                              Level 7
                                                              kenewing,

                                                              > All makes sense.

                                                              Cool.

                                                              > I inserted the action scripts as suggested adapting all
                                                              > the names to suit. When I generate the swf file, I get
                                                              > the following two error messages:
                                                              >
                                                              > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                                              > Statement must appear within on handler
                                                              > btnPlay.onRelease = function() {
                                                              >

                                                              That means you're pasting the code directly on the button, rather than
                                                              in the main timeline. If you're pasting directly to the button, you need to
                                                              put your code within an on() or onClipEvent() handler. That's how things
                                                              were done back in Flash 5, but the current best practices recommendation is
                                                              that you put your code in a layer of the main timeline. That's the reason
                                                              for instance names on your movie clips: the code sits in a timeline and
                                                              calls the desired clips by name. When code is in an on() handler, it's
                                                              directly attached, so instance names aren't necessary.

                                                              Here are some thoughts on the matter.

                                                              http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                                              David Stiller
                                                              Adobe Community Expert
                                                              Dev blog, http://www.quip.net/blog/
                                                              "Luck is the residue of good design."


                                                              • 28. Re: Embedding a series of stop points in a timeline
                                                                Level 7
                                                                kenewing,

                                                                > All makes sense.

                                                                Cool.

                                                                > I inserted the action scripts as suggested adapting all
                                                                > the names to suit. When I generate the swf file, I get
                                                                > the following two error messages:
                                                                >
                                                                > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                                                > Statement must appear within on handler
                                                                > btnPlay.onRelease = function() {
                                                                >

                                                                That means you're pasting the code directly on the button, rather than
                                                                in the main timeline. If you're pasting directly to the button, you need to
                                                                put your code within an on() or onClipEvent() handler. That's how things
                                                                were done back in Flash 5, but the current best practices recommendation is
                                                                that you put your code in a layer of the main timeline. That's the reason
                                                                for instance names on your movie clips: the code sits in a timeline and
                                                                calls the desired clips by name. When code is in an on() handler, it's
                                                                directly attached, so instance names aren't necessary.

                                                                Here are some thoughts on the matter.

                                                                http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                                                David Stiller
                                                                Adobe Community Expert
                                                                Dev blog, http://www.quip.net/blog/
                                                                "Luck is the residue of good design."


                                                                • 29. Re: Embedding a series of stop points in a timeline
                                                                  Level 7
                                                                  kenewing,

                                                                  > All makes sense.

                                                                  Cool.

                                                                  > I inserted the action scripts as suggested adapting all
                                                                  > the names to suit. When I generate the swf file, I get
                                                                  > the following two error messages:
                                                                  >
                                                                  > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                                                  > Statement must appear within on handler
                                                                  > btnPlay.onRelease = function() {
                                                                  >

                                                                  That means you're pasting the code directly on the button, rather than
                                                                  in the main timeline. If you're pasting directly to the button, you need to
                                                                  put your code within an on() or onClipEvent() handler. That's how things
                                                                  were done back in Flash 5, but the current best practices recommendation is
                                                                  that you put your code in a layer of the main timeline. That's the reason
                                                                  for instance names on your movie clips: the code sits in a timeline and
                                                                  calls the desired clips by name. When code is in an on() handler, it's
                                                                  directly attached, so instance names aren't necessary.

                                                                  Here are some thoughts on the matter.

                                                                  http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                                                  David Stiller
                                                                  Adobe Community Expert
                                                                  Dev blog, http://www.quip.net/blog/
                                                                  "Luck is the residue of good design."


                                                                  • 30. Re: Embedding a series of stop points in a timeline
                                                                    Level 7
                                                                    kenewing,

                                                                    > All makes sense.

                                                                    Cool.

                                                                    > I inserted the action scripts as suggested adapting all
                                                                    > the names to suit. When I generate the swf file, I get
                                                                    > the following two error messages:
                                                                    >
                                                                    > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                                                    > Statement must appear within on handler
                                                                    > btnPlay.onRelease = function() {
                                                                    >

                                                                    That means you're pasting the code directly on the button, rather than
                                                                    in the main timeline. If you're pasting directly to the button, you need to
                                                                    put your code within an on() or onClipEvent() handler. That's how things
                                                                    were done back in Flash 5, but the current best practices recommendation is
                                                                    that you put your code in a layer of the main timeline. That's the reason
                                                                    for instance names on your movie clips: the code sits in a timeline and
                                                                    calls the desired clips by name. When code is in an on() handler, it's
                                                                    directly attached, so instance names aren't necessary.

                                                                    Here are some thoughts on the matter.

                                                                    http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                                                    David Stiller
                                                                    Adobe Community Expert
                                                                    Dev blog, http://www.quip.net/blog/
                                                                    "Luck is the residue of good design."


                                                                    • 31. Re: Embedding a series of stop points in a timeline
                                                                      Level 7
                                                                      kenewing,

                                                                      > All makes sense.

                                                                      Cool.

                                                                      > I inserted the action scripts as suggested adapting all
                                                                      > the names to suit. When I generate the swf file, I get
                                                                      > the following two error messages:
                                                                      >
                                                                      > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                                                      > Statement must appear within on handler
                                                                      > btnPlay.onRelease = function() {
                                                                      >

                                                                      That means you're pasting the code directly on the button, rather than
                                                                      in the main timeline. If you're pasting directly to the button, you need to
                                                                      put your code within an on() or onClipEvent() handler. That's how things
                                                                      were done back in Flash 5, but the current best practices recommendation is
                                                                      that you put your code in a layer of the main timeline. That's the reason
                                                                      for instance names on your movie clips: the code sits in a timeline and
                                                                      calls the desired clips by name. When code is in an on() handler, it's
                                                                      directly attached, so instance names aren't necessary.

                                                                      Here are some thoughts on the matter.

                                                                      http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                                                      David Stiller
                                                                      Adobe Community Expert
                                                                      Dev blog, http://www.quip.net/blog/
                                                                      "Luck is the residue of good design."


                                                                      • 32. Re: Embedding a series of stop points in a timeline
                                                                        Level 7
                                                                        kenewing,

                                                                        > All makes sense.

                                                                        Cool.

                                                                        > I inserted the action scripts as suggested adapting all
                                                                        > the names to suit. When I generate the swf file, I get
                                                                        > the following two error messages:
                                                                        >
                                                                        > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                                                        > Statement must appear within on handler
                                                                        > btnPlay.onRelease = function() {
                                                                        >

                                                                        That means you're pasting the code directly on the button, rather than
                                                                        in the main timeline. If you're pasting directly to the button, you need to
                                                                        put your code within an on() or onClipEvent() handler. That's how things
                                                                        were done back in Flash 5, but the current best practices recommendation is
                                                                        that you put your code in a layer of the main timeline. That's the reason
                                                                        for instance names on your movie clips: the code sits in a timeline and
                                                                        calls the desired clips by name. When code is in an on() handler, it's
                                                                        directly attached, so instance names aren't necessary.

                                                                        Here are some thoughts on the matter.

                                                                        http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                                                        David Stiller
                                                                        Adobe Community Expert
                                                                        Dev blog, http://www.quip.net/blog/
                                                                        "Luck is the residue of good design."


                                                                        • 33. Re: Embedding a series of stop points in a timeline
                                                                          Level 7
                                                                          kenewing,

                                                                          > All makes sense.

                                                                          Cool.

                                                                          > I inserted the action scripts as suggested adapting all
                                                                          > the names to suit. When I generate the swf file, I get
                                                                          > the following two error messages:
                                                                          >
                                                                          > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                                                          > Statement must appear within on handler
                                                                          > btnPlay.onRelease = function() {
                                                                          >

                                                                          That means you're pasting the code directly on the button, rather than
                                                                          in the main timeline. If you're pasting directly to the button, you need to
                                                                          put your code within an on() or onClipEvent() handler. That's how things
                                                                          were done back in Flash 5, but the current best practices recommendation is
                                                                          that you put your code in a layer of the main timeline. That's the reason
                                                                          for instance names on your movie clips: the code sits in a timeline and
                                                                          calls the desired clips by name. When code is in an on() handler, it's
                                                                          directly attached, so instance names aren't necessary.

                                                                          Here are some thoughts on the matter.

                                                                          http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                                                          David Stiller
                                                                          Adobe Community Expert
                                                                          Dev blog, http://www.quip.net/blog/
                                                                          "Luck is the residue of good design."


                                                                          • 34. Re: Embedding a series of stop points in a timeline
                                                                            Level 7
                                                                            kenewing,

                                                                            > All makes sense.

                                                                            Cool.

                                                                            > I inserted the action scripts as suggested adapting all
                                                                            > the names to suit. When I generate the swf file, I get
                                                                            > the following two error messages:
                                                                            >
                                                                            > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                                                            > Statement must appear within on handler
                                                                            > btnPlay.onRelease = function() {
                                                                            >

                                                                            That means you're pasting the code directly on the button, rather than
                                                                            in the main timeline. If you're pasting directly to the button, you need to
                                                                            put your code within an on() or onClipEvent() handler. That's how things
                                                                            were done back in Flash 5, but the current best practices recommendation is
                                                                            that you put your code in a layer of the main timeline. That's the reason
                                                                            for instance names on your movie clips: the code sits in a timeline and
                                                                            calls the desired clips by name. When code is in an on() handler, it's
                                                                            directly attached, so instance names aren't necessary.

                                                                            Here are some thoughts on the matter.

                                                                            http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                                                            David Stiller
                                                                            Adobe Community Expert
                                                                            Dev blog, http://www.quip.net/blog/
                                                                            "Luck is the residue of good design."


                                                                            • 35. Re: Embedding a series of stop points in a timeline
                                                                              Level 7
                                                                              kenewing,

                                                                              > All makes sense.

                                                                              Cool.

                                                                              > I inserted the action scripts as suggested adapting all
                                                                              > the names to suit. When I generate the swf file, I get
                                                                              > the following two error messages:
                                                                              >
                                                                              > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                                                              > Statement must appear within on handler
                                                                              > btnPlay.onRelease = function() {
                                                                              >

                                                                              That means you're pasting the code directly on the button, rather than
                                                                              in the main timeline. If you're pasting directly to the button, you need to
                                                                              put your code within an on() or onClipEvent() handler. That's how things
                                                                              were done back in Flash 5, but the current best practices recommendation is
                                                                              that you put your code in a layer of the main timeline. That's the reason
                                                                              for instance names on your movie clips: the code sits in a timeline and
                                                                              calls the desired clips by name. When code is in an on() handler, it's
                                                                              directly attached, so instance names aren't necessary.

                                                                              Here are some thoughts on the matter.

                                                                              http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                                                              David Stiller
                                                                              Adobe Community Expert
                                                                              Dev blog, http://www.quip.net/blog/
                                                                              "Luck is the residue of good design."


                                                                              • 36. Re: Embedding a series of stop points in a timeline
                                                                                Level 7
                                                                                kenewing,

                                                                                > All makes sense.

                                                                                Cool.

                                                                                > I inserted the action scripts as suggested adapting all
                                                                                > the names to suit. When I generate the swf file, I get
                                                                                > the following two error messages:
                                                                                >
                                                                                > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                                                                > Statement must appear within on handler
                                                                                > btnPlay.onRelease = function() {
                                                                                >

                                                                                That means you're pasting the code directly on the button, rather than
                                                                                in the main timeline. If you're pasting directly to the button, you need to
                                                                                put your code within an on() or onClipEvent() handler. That's how things
                                                                                were done back in Flash 5, but the current best practices recommendation is
                                                                                that you put your code in a layer of the main timeline. That's the reason
                                                                                for instance names on your movie clips: the code sits in a timeline and
                                                                                calls the desired clips by name. When code is in an on() handler, it's
                                                                                directly attached, so instance names aren't necessary.

                                                                                Here are some thoughts on the matter.

                                                                                http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                                                                David Stiller
                                                                                Adobe Community Expert
                                                                                Dev blog, http://www.quip.net/blog/
                                                                                "Luck is the residue of good design."


                                                                                • 37. Re: Embedding a series of stop points in a timeline
                                                                                  Level 7
                                                                                  kenewing,

                                                                                  > All makes sense.

                                                                                  Cool.

                                                                                  > I inserted the action scripts as suggested adapting all
                                                                                  > the names to suit. When I generate the swf file, I get
                                                                                  > the following two error messages:
                                                                                  >
                                                                                  > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                                                                  > Statement must appear within on handler
                                                                                  > btnPlay.onRelease = function() {
                                                                                  >

                                                                                  That means you're pasting the code directly on the button, rather than
                                                                                  in the main timeline. If you're pasting directly to the button, you need to
                                                                                  put your code within an on() or onClipEvent() handler. That's how things
                                                                                  were done back in Flash 5, but the current best practices recommendation is
                                                                                  that you put your code in a layer of the main timeline. That's the reason
                                                                                  for instance names on your movie clips: the code sits in a timeline and
                                                                                  calls the desired clips by name. When code is in an on() handler, it's
                                                                                  directly attached, so instance names aren't necessary.

                                                                                  Here are some thoughts on the matter.

                                                                                  http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                                                                  David Stiller
                                                                                  Adobe Community Expert
                                                                                  Dev blog, http://www.quip.net/blog/
                                                                                  "Luck is the residue of good design."


                                                                                  • 38. Re: Embedding a series of stop points in a timeline
                                                                                    Level 7
                                                                                    kenewing,

                                                                                    > All makes sense.

                                                                                    Cool.

                                                                                    > I inserted the action scripts as suggested adapting all
                                                                                    > the names to suit. When I generate the swf file, I get
                                                                                    > the following two error messages:
                                                                                    >
                                                                                    > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                                                                    > Statement must appear within on handler
                                                                                    > btnPlay.onRelease = function() {
                                                                                    >

                                                                                    That means you're pasting the code directly on the button, rather than
                                                                                    in the main timeline. If you're pasting directly to the button, you need to
                                                                                    put your code within an on() or onClipEvent() handler. That's how things
                                                                                    were done back in Flash 5, but the current best practices recommendation is
                                                                                    that you put your code in a layer of the main timeline. That's the reason
                                                                                    for instance names on your movie clips: the code sits in a timeline and
                                                                                    calls the desired clips by name. When code is in an on() handler, it's
                                                                                    directly attached, so instance names aren't necessary.

                                                                                    Here are some thoughts on the matter.

                                                                                    http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                                                                    David Stiller
                                                                                    Adobe Community Expert
                                                                                    Dev blog, http://www.quip.net/blog/
                                                                                    "Luck is the residue of good design."


                                                                                    • 39. Re: Embedding a series of stop points in a timeline
                                                                                      Level 7
                                                                                      kenewing,

                                                                                      > All makes sense.

                                                                                      Cool.

                                                                                      > I inserted the action scripts as suggested adapting all
                                                                                      > the names to suit. When I generate the swf file, I get
                                                                                      > the following two error messages:
                                                                                      >
                                                                                      > **Error** Scene=Scene 1, layer=layer_name, frame=1:Line 1:
                                                                                      > Statement must appear within on handler
                                                                                      > btnPlay.onRelease = function() {
                                                                                      >

                                                                                      That means you're pasting the code directly on the button, rather than
                                                                                      in the main timeline. If you're pasting directly to the button, you need to
                                                                                      put your code within an on() or onClipEvent() handler. That's how things
                                                                                      were done back in Flash 5, but the current best practices recommendation is
                                                                                      that you put your code in a layer of the main timeline. That's the reason
                                                                                      for instance names on your movie clips: the code sits in a timeline and
                                                                                      calls the desired clips by name. When code is in an on() handler, it's
                                                                                      directly attached, so instance names aren't necessary.

                                                                                      Here are some thoughts on the matter.

                                                                                      http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent


                                                                                      David Stiller
                                                                                      Adobe Community Expert
                                                                                      Dev blog, http://www.quip.net/blog/
                                                                                      "Luck is the residue of good design."


                                                                                      1 2 Previous Next