6 Replies Latest reply on Aug 25, 2008 10:51 AM by Newsgroup_User

    How do I reference an embedded cue point with AS?

    Level 1
      I've looked for a solution to this in many forums and also in Flash help, but can't quite get the response I need.

      I've embedded a cue point when encoding a video. The name of the cue point is cuePtEnd, time is 00:00:06.00 (6 secs), and type is Event. I did not define any parameters.

      I'm attaching a video dynamically using NetConnection and NetStream, i.e. I'm not using components. My video loads and plays and all the video buttons work fine as well. I want my video to return to the beginning and stop when I click a button and/or cuePtEnd is reached. I've tried using seek(0), but this returns the video to the beginning and starts playing again.

      I'm using the following code to activate something else on stage when cuePtEnd is reached and it works; however, the only reason this code works is because I've embedded only one cue point in my video file. How do I reference a specific cue point and not the first cue point that Flash finds in my video file?

        • 1. Re: How do I reference an embedded cue point with AS?
          Level 7
          kabunia,

          > I understand, for the most part, how this code works. Flash
          > searches for any embedded cue point that does not contain
          > parameters and once it's reached it traces the phrase.

          I haven't tried your code in a practical application, but my hunch is
          that it may not work as expected. Even if a cue point doesn't have
          parameters, it may very well have a parameters *property* ... it's just be
          that the property's value might be null. (This is ony a hunch, through, so
          you should run some exeriments to test it for sure.)

          The long and short of it is that you might want to check of the
          cue_info.parameters property == null (or != null, as the case may be).

          > But, how do I get Flash to disregard all other embedded
          > cue points, and trace this statement only when cuePtEnd
          > at 6 secs is reached?

          You can always check the time property. (there are other properties
          besides the parameters one you've seen).

          See if this tutorial steers you in the right direction.

          http://www.quip.net/blog/2007/flash/how-to-use-flash-video-cue-points

          I'll be happy to answer additional questions, if you have any.


          David Stiller
          Co-author, Foundation Flash CS3 for Designers
          http://tinyurl.com/2k29mj
          "Luck is the residue of good design."


          • 2. Re: How do I reference an embedded cue point with AS?
            Level 1
            David, thank you for you response. I posted a comment on your blog site.

            Your tutorials really helped me understand how to reference specific embedded cue points. Also, I understand how to check if a video has reached the end. Once the video reaches the end, I want it to return to the beginning and stop. I need a function that's similar to gotoAndStop, and seekAndStop(0) is definitely not it, but don't think I didn't try it :). I've also tried, my_ns.seek(0), and my_ns.pause(), but this does not truly stop at 00:00:00.00.

            I'm not using components. Any suggestions?

            Thank you.
            • 3. Re: How do I reference an embedded cue point with AS?
              Level 7
              kabunia,

              > Your tutorials really helped me understand how to reference
              > specific embedded cue points. Also, I understand how to
              > check if a video has reached the end.

              Nice. Glad to hear that. :)

              > Once the video reaches the end, I want it to return to the
              > beginning and stop. I need a function that's similar to
              > gotoAndStop, and seekAndStop(0) is definitely not it, but
              > don't think I didn't try it :)

              Heh. Do you realize that all you have to do is look up the NetStream
              class in the ActionScript 2.0 Language Reference, and you'll see everything
              the class is capable of? No need to guess! Class entries describe the
              objects they create. You'll find a list of the class's properties, which
              are the characteristics it has. You'll find methods, which are the things
              it can do. You'll find events, which are the things it can react to.

              > I've also tried, my_ns.seek(0), and my_ns.pause(), but this does
              > not truly stop at 00:00:00.00.

              I would pause the stream first, then seek to 0. I wonder doing that in
              reverse gives your video just enough time to advance a few frames past 0?


              David Stiller
              Contributor, How to Cheat in Flash CS3
              http://tinyurl.com/2cp6na
              "Luck is the residue of good design."


              • 4. Re: How do I reference an embedded cue point with AS?
                Level 7
                kabunia,

                I should give you a heads-up ... I'll continue to check in on this
                thread, but I'm about to leave for San Francisco in a few hours for
                Flashforward. For the first time, I'm going to be attending without taking
                a laptop (that's going to be refreshing!) ... so it will be several days
                before I can reply ... in case you have additional questions.


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


                • 5. Re: How do I reference an embedded cue point with AS?
                  Level 1
                  David, thanks again for your response. While Flash help is helpful, I really struggled finding a way to return a video to the beginning and stop. I also thought it would be simpler than having to use two functions, seek and pause. I will try your suggestion and use pause first, then seek(0).

                  I appreciate your time and enjoy SF...without the laptop.
                  • 6. Re: How do I reference an embedded cue point with AS?
                    Level 7
                    kabunia,

                    > While Flash help is helpful, I really struggled finding a way
                    > to return a video to the beginning and stop.

                    I can be tough, that's for sure -- and the combination of NetConnection,
                    NetStream, and Video isn't as straightforward as other objects -- but it
                    does get easier with practice.

                    > I also thought it would be simpler than having to use two
                    > functions, seek and pause.

                    True, some methods/functions encompass more functionality than others,
                    but the important part here is that you do indeed have the mechanism to
                    accomplish what you're after. In fact, when you feel more comfortable with
                    ActionScript, you could write a custom class of your own, that includes a
                    seekToAndStop() method, or something like it. :)

                    > I will try your suggestion and use pause first, then seek(0).
                    >
                    > I appreciate your time and enjoy SF...without the laptop.

                    It was great!


                    David Stiller
                    Co-author, Foundation Flash CS3 for Designers
                    http://tinyurl.com/2k29mj
                    "Luck is the residue of good design."