6 Replies Latest reply on May 26, 2006 8:10 AM by Newsgroup_User

    getURL after FLV stop

    Level 7

      Hi there,

      I would like to go to a different webpage after
      the FLV in the present page has stopped.

      Here is my code... which isn't working:

      var myListener = new Object();
      myListener.stop = function(){
      getURL(" http://www.mysite.com/home.htm");
      trace("video ended");
      };
      player_mc.addEventListener("stop",myListener);

      Any ideas?
      Regards,
      Toe Cutter



        • 1. Re: getURL after FLV stop
          Level 7

          Hi Again,

          I got the trace to work again in this case:

          stop();

          var myListener = new Object();
          myListener.stop = function():Void
          {
          getURL(" http://www.mysite.com/home.htm");
          }
          {
          trace("video complete");

          But, still no getURL.


          "Toe Cutter" <newsgroup@macromedia.com> wrote in message
          news:e4i5ni$ga$1@forums.macromedia.com...
          >
          >
          > Hi there,
          >
          > I would like to go to a different webpage after
          > the FLV in the present page has stopped.
          >
          > Here is my code... which isn't working:
          >
          > var myListener = new Object();
          > myListener.stop = function(){
          > getURL(" http://www.mysite.com/home.htm");
          > trace("video ended");
          > };
          > player_mc.addEventListener("stop",myListener);
          >
          > Any ideas?
          > Regards,
          > Toe Cutter
          >
          >
          >
          >



          • 2. Re: getURL after FLV stop
            Nickels55 Level 2
            Did you publish it and try it externally? I don't think getURL works until published, but I am not 100% sure.
            • 3. Re: getURL after FLV stop
              Level 7

              Hi there,

              Yes, I published it as in html file with a Flash 7 SWF.
              When I mix the code around, I am able to get the getURL to function
              immediately,
              but it bypasses the FLV all together.

              I feel I am close, but I am not very savvy with ActionScript.
              Something is missing, but I just can't speak the Lingo.. err ActionScript.

              Regards,
              Toe Cutter

              "Nickels55" <webforumsuser@macromedia.com> wrote in message
              news:e4ih3c$fi7$1@forums.macromedia.com...
              >
              > Did you publish it and try it externally? I don't think getURL works until
              published, but I am not 100% sure.
              >



              • 4. Re: getURL after FLV stop
                Level 7

                Okay,

                I think I found the answer.
                For one reason or another, the word "stop"
                has some 'deep down scripting significance' because
                when I changed the word "stop" to "complete",
                it all worked he way I wanted.

                Here is the code, I hope it helps someone:

                stop();

                var myListener = new Object();
                myListener.complete = function():Void
                {
                getURL(" http://www.mysite.com/home.htm");
                }
                {
                trace("video complete");
                }
                video.addEventListener("complete",myListener);

                Regards,
                Toe Cutter

                "Toe Cutter" <newsgroup@macromedia.com> wrote in message
                news:e4ihkg$g7d$1@forums.macromedia.com...
                >
                >
                > Hi there,
                >
                > Yes, I published it as in html file with a Flash 7 SWF.
                > When I mix the code around, I am able to get the getURL to function
                > immediately,
                > but it bypasses the FLV all together.
                >
                > I feel I am close, but I am not very savvy with ActionScript.
                > Something is missing, but I just can't speak the Lingo.. err ActionScript.
                >
                > Regards,
                > Toe Cutter
                >
                > "Nickels55" <webforumsuser@macromedia.com> wrote in message
                > news:e4ih3c$fi7$1@forums.macromedia.com...
                > >
                > > Did you publish it and try it externally? I don't think getURL works
                until
                > published, but I am not 100% sure.
                > >
                >
                >
                >
                >



                • 5. Re: getURL after FLV stop
                  Dcon
                  Establish a variable by using a Dynamic Text field, place it on the stage so you can see it.
                  In this case I am calling it "cue", (not to be confused with .flv cuePoints).
                  Next, code an onClipEvent on the flvplay back clip (in this case I named it my_flvPb).

                  Then write this code:

                  onClipEvent (enterFrame) {
                  this.cue = this.my_flvPb.playheadTime;
                  if (this.cue>200) {
                  getURL(URL,window,method);
                  }
                  }

                  // This sets the variable "cue" to the playheadTime & since you are using an onClipEvent this action repeats at the frame rate you set for the Flash Player. When you run it you will see this variable display the playheadTime as it changes. In this case as soon as the playheadTime is > 200 the Get URL action (or what ever action you want to do) occurs.

                  After you have observed your .flv file play & noted the final value of "cue", you can adjust the >200 to a value lower or higher that works best for you.
                  I hope this is helpful.

                  dcon
                  • 6. Re: getURL after FLV stop
                    Level 7
                    on frame where your mediaDisplay resides add this code:

                    stop();
                    var myListener: Object = new Object();
                    myListener.complete = function(eventObj: Object) {
                    trace("media is Finished");
                    getURL("/nextPage.html");
                    };
                    myMedia.addEventListener("complete", myListener);

                    //"myMedia" is the instance name of your mediaPlayer.

                    hope this helps.


                    ******************************************
                    --> **Adobe Certified Expert**
                    --> www.mudbubble.com
                    --> www.keyframer.com




                    Toe Cutter wrote:
                    >
                    > Hi there,
                    >
                    > I would like to go to a different webpage after
                    > the FLV in the present page has stopped.
                    >
                    > Here is my code... which isn't working:
                    >
                    > var myListener = new Object();
                    > myListener.stop = function(){
                    > getURL(" http://www.mysite.com/home.htm");
                    > trace("video ended");
                    > };
                    > player_mc.addEventListener("stop",myListener);
                    >
                    > Any ideas?
                    > Regards,
                    > Toe Cutter
                    >
                    >
                    >