12 Replies Latest reply on Jan 26, 2007 11:03 AM by abeall

    getURL AFTER movie plays

    ivanarias
      i'm trying to play a .flv file that is called from within a .swf

      i've got that part working using flash by just importing the video into scene 1. it plays the video.

      now when the video has finished playing -- and not until then -- i then want to do a getURL to splash.htm in order for the viewer to be taken to another page on the site where there is a nice looping graphic for them to see but only AFTER the video has finished playing

      i don't know where to put the getURL. i assume i'm not expected to figure out precisely on which frame number the movie is going to finish playing and put the getURL there right?

      isn't there a way for it to do the getURL after and only after the .flv movie has finished playing, whenever that may be?

      as it is now, it does the getURL before the video has finished playing with the frame i've got it on now or if i put the getURL in the next scene it just does the getURL before the video has had a chance to play through

      is there a way for it to know that the video is playing and not launch the getURL until it's done?

      i'm looking for a way to do this using the guided script, i don't know code
        • 1. Re: getURL AFTER movie plays
          abeall Level 3
          > is there a way for it to know that the video is playing and not launch the getURL
          > until it's done?

          How are you actually playing the video? You would use NetStream.onStatus to determine when an .flv is done playing. Look it up in the docs, and report back if you have trouble implementing it.
          • 2. Re: getURL AFTER movie plays
            ivanarias Level 1
            How am I playing it? I opened up a New Flash Document in Macromedia Flash Professional 8. I did a File > Import Video and then specified the .flv file and opted for 'Progressive Download for a Web Server' option. It processed that and I had a video on the stage, that's it.

            Then File > Export Movie creates a .swf file that apparently automatically calls and plays the .flv file. I didn't add any code or actions or anything and it plays.

            Does that tell you how I'm playing the video or might I be leaving something out?

            I looked up NetStream.onStatus but I don't know code and it's pretty Greek to me...what exactly am I supposed to do to get it to do a getURL action after the movie has played? I'm not even sure where the code would go, like on which frame...within the same scene where the video is playing I assume?

            For comparison on ease of use, the swishvideo program I was using has a toggle button on the export options that you just click and then type in the URL you want launched, so this is pretty far removed for me in terms of complexity...
            • 3. Re: getURL AFTER movie plays
              abeall Level 3
              Yes, that does tell me how you are playing it. The result of that process will create an instance of a FLV playback component of some type, and automatically set the compontent to load your FLV. You should click on the component, see what its called in the Properties panel, then look it up in the docs Component Reference. I know that the Media Display component has a 'complete' event, something like this:
              function complete(eventObj) {
              getURL(' http://etc');
              };
              myMedia.addEventListener("complete", this);

              You would put that actionscript on a frame that the media display exists on. Then just make sure your component has a name of myMedia, or whatever.

              I'm not sure if importing the way you have uses the Media Display, it might use a different FLV component, that's just one example.
              • 4. Re: getURL AFTER movie plays
                zensoldier
                Here ya go

                var listenerObject:Object = new Object();
                listenerObject.complete = function(eventObject:Object):Void {
                //whatever you want to happen when it is complete
                }
                playbackControl.addEventListener("complete", listenerObject);
                • 5. Re: getURL AFTER movie plays
                  ivanarias Level 1
                  I'm doing something wrong -- though I admit I barely understand what you're saying (that's how novice I am!); anyway, I've got this:

                  var listenerObject:Object = new Object();
                  listenerObject.complete = function(eventObject:Object):Void {
                  getURL('splash.htm');
                  }
                  playbackControl.addEventListener("complete",listenerObject);


                  I stuck that in the script box after clicking on the first frame of the timeline. The Component, by the way, appears to be called FLVPlayback I believe. It plays the video no problem which is the good news, but nothing happens at the end (the getURL that I want it to find).

                  Can someone break this down for me in idiot terms? I barely know where or what the script box is, let alone looking up component references and what media display even refers to.
                  • 6. Re: getURL AFTER movie plays
                    abeall Level 3
                    Sounds like you put the code in the right place. But the key here is to make sure your component has a name. Click on the FLVPlayback component, look in the Properties panel, and there should be an input field in the top left, with a default value of <instance name> faded out in grey. This is where you define a name. You can choose a name, but avoid using spaces or any special characters. The above example assumes you have given it the name "playbackControl", in this line of code:
                    playbackControl.addEventListener("complete",listenerObject);

                    Let's say you gave the component an instance name of "myVideo_flv". That line would have to change to:
                    myVideo_flv.addEventListener("complete",listenerObject);

                    Hope that helps.
                    • 7. Re: getURL AFTER movie plays
                      ivanarias Level 1
                      Thank you! That's the kind of breakdown I need to understand it; only thing now I went back and changed that (stupidly, I hadn't saved the previous project) and this time when I play the resulting .swf back, the code is written across the video screen so I guess I put the text on the screen somehow? Any idea what the hell I just did? LOL
                      • 8. Re: getURL AFTER movie plays
                        ivanarias Level 1
                        Okay, disregard that previous message about the text, I just started over and that's good now.
                        • 9. Re: getURL AFTER movie plays
                          ivanarias Level 1
                          Okay, I think I got it -- it's working locally now for the first time! It's not working online though, I thought I'd already uploaded all the relevant files but maybe not so I'm redoing it now.

                          One thing though, I notice when inserting the .swf onto a page in Dreamweaver, the SRC lists the local path for the .fla file -- does the .fla file also need to be saved within the website folder? I thought that was just the project file, akin to saving the .psd file for a Photoshop project when all you want is a resultant .jpg or something to go on the website...?
                          • 10. Re: getURL AFTER movie plays
                            ivanarias Level 1
                            Okay, I think I got it -- it's working locally now for the first time! It's not working online though, I thought I'd already uploaded all the relevant files but maybe not so I'm redoing it now.

                            One thing though, I notice when inserting the .swf onto a page in Dreamweaver, the SRC lists the local path for the .fla file -- does the .fla file also need to be saved within the website folder? I thought that was just the project file, akin to saving the .psd file for a Photoshop project when all you want is a resultant .jpg or something to go on the website...?
                            • 11. Re: getURL AFTER movie plays
                              ivanarias Level 1
                              Well, it's working locally but not on the website. Any idea what I could be overlooking? I mean I assume it has to do with the source .flv or relative/absolute paths, but everything seems fine...
                              • 12. Re: getURL AFTER movie plays
                                abeall Level 3
                                What doesn't work online? Does the FLV play at all?

                                You will need the .flv and probably 2 .swfs. One .swf will be the FLVPlayback skin, the other will be your movie. You are right, you won't need the .fla. I am not familiar with DW, how did you embed the .swf?