12 Replies Latest reply on Aug 14, 2007 1:37 PM by kglad

    video trigger flash movie

    janst Level 1
      Hi,

      I am creating a website where my client wants a Flash movie to start as soon as his video finishes playing. The video really needs to stream. It's too big to embed. So far I have tried a timer and also embedding the video just to see how many frames it would be and then placing the movie on that frame number of the time line while using the video as streaming as opposed to embedded. In both cases, the Flash movie does not ever appear to start consistently when I want it to start. I don't know if by nature the streaming movie has a varied number of frames per second or whether I am just being really dumb about my approach.

      Does this make sense to anyone and is there a way to make this work? I have been searching Flash books and scouring the web and haven't yet found anything that will work for me.

      I am using Flash 8.
        • 1. Re: video trigger flash movie
          kglad Adobe Community Professional & MVP
          is the video an flv file that's playing in flash? if so, are you using the flvplayback component?
          • 2. Re: video trigger flash movie
            janst Level 1
            Hi,


            I have Flash 8 Professional and I used the import wizard to import the video and chose the "Stream from Flash video streaming service" with no controls chosen... I am not proficient with Action Script (trying to get my brain around it)... I am a designer (please don't yawn!)... I do have some background in using HTML and JavaScipt...

            I found something in the help section and am trying to implement it... not sure if this is the right approach:
            quote:


            Example
            The following example displays the current position of the playhead in a dynamically created text field called time_txt. Select New Video from the Library options menu to create a video object instance, and give it an instance name my_video. Create a new video object called my_video. Add the following ActionScript to your FLA or AS file:

            var connection_nc:NetConnection = new NetConnection();
            connection_nc.connect(null);
            var stream_ns:NetStream = new NetStream(connection_nc);
            my_video.attachVideo(stream_ns);
            stream_ns.play("video1.flv");
            //
            stream_ns.onStatus = function(infoObject:Object) {
            statusCode_txt.text = infoObject.code;
            };

            this.createTextField("time_txt", this.getNextHighestDepth(), 10, 10, 100, 22);
            time_txt.text = "LOADING";

            var time_interval:Number = setInterval(checkTime, 500, stream_ns);
            function checkTime(my_ns:NetStream) {
            var ns_seconds:Number = my_ns.time;
            var minutes:Number = Math.floor(ns_seconds/60);
            var seconds = Math.floor(ns_seconds%60);
            if (seconds<10) {
            seconds = "0"+seconds;
            }
            time_txt.text = minutes+":"+seconds;
            }




            The scenario is that I have a video playing and when it reaches it's end, I need to have a Flash movie start playing in the same space where the video had been playing.

            Good advice as far as a book, on-line tutorial, or dvd would be appreciated as well.

            THANKS!!
            • 3. Re: video trigger flash movie
              kglad Adobe Community Professional & MVP
              it doesn't matter which you use. but pick one.

              which are you going to use?
              • 4. Re: video trigger flash movie
                janst Level 1
                Hi kglad,

                Can I email you a link to the unfinished project?
                • 5. Re: video trigger flash movie
                  janst Level 1
                  The flvplayback component seems less complicated... Could you walk me though?

                  So sorry... feeling so stupid with this one!
                  • 6. Re: video trigger flash movie
                    kglad Adobe Community Professional & MVP
                    after you finish your import wizard you should have an FLVPlayBack instance on-stage. give this an instance name (say flvPB) and attach the following code to the first frame that contains your playback component:

                    • 7. Re: video trigger flash movie
                      janst Level 1
                      I'm having one of those days.... did you catch how my named signed off as my computer crashed??

                      I'm trying the above right now...
                      • 8. Re: video trigger flash movie
                        janst Level 1
                        Okay... I cannot believe how simple that is and how stupid I have been about this... I have been expecting the solution to be much more complicated!!!
                        • 9. Re: video trigger flash movie
                          janst Level 1
                          If I wanted the Object to be a loadMovienum action, could I do that?
                          • 10. Re: video trigger flash movie
                            kglad Adobe Community Professional & MVP
                            try:

                            • 11. Re: video trigger flash movie
                              janst Level 1
                              Wow!

                              You are truly wonderful!

                              You need an icon with a cape and a big letter 's' ! Super kglad to the rescue!

                              Thank you so much!
                              • 12. Re: video trigger flash movie
                                kglad Adobe Community Professional & MVP
                                you're welcome.