10 Replies Latest reply on May 21, 2007 7:14 AM by scriptheadache

    Playing multiple FLV files with actionscript 2.0

    scriptheadache

      Hi,

      I am trying to play a sequence of .flv using the example given in the Flash help pages. It works, but I can not figure out how to add a third, four, fifth, etc. .flv files. I am progressive streaming. The site's new, it's in beta, I am the whole enchilada and I am having a little trouble.

      Okay, this is what works, can anyone add to this code to demonstrate how I would continue adding more .flv files.

      Thank you.

      JR

        • 1. Playing multiple FLV files with actionscript 2.0
          Greg Dove Level 4
          Try something like this. If you are really changing things a lot in terms of the number and sequence of FLVs, then you could put the list in an external text file and load using LoadVars or into an xml file and load using the xml object. That way you don't have to change your fla each time and recompile just to change your videos / video sequence.

          [I haven't tested this... just typed it quickly here so if there are errors let me know.]
          • 2. Re: Playing multiple FLV files with actionscript 2.0
            scriptheadache Level 1
            Dear GWD,

            Thank you for your reply.

            I tested the script and it's producing a few errors, which I have posted. From what I have researched, attaching the script directly to an instance causes this error, but I am attaching the script to the first frame of the action layer. Being a novice to Actionscript your script looks absolutely fine, I just want to make sure I am not making errors trying to apply it.

            Oddly, the script does not produce errors if I only use line 6 down.

            I am open to more assistance if you have the time.

            Thank you again for your reply.

            JR
            • 3. Re: Playing multiple FLV files with actionscript 2.0
              Greg Dove Level 4
              Are you using Flash 8 ? I just copied and pasted that code into an empty keyframe and did a check syntax. It was fine - no problems.
              I'm not sure what 'Clipboard actions' means in the error reporting...
              • 4. Re: Playing multiple FLV files with actionscript 2.0
                scriptheadache Level 1
                Hi GWD,

                Yes, I am using Flash 8. and I had script assistant on which was preventing the copy and paste of the clipboard because the script, so flash says, has suntax errors. hence the "Clipboard errors" display, sorry.

                I de-armed the script assisant, pasted the script, but the movie files won't load. The flvplayer buffer window on the skin keeps seeking. When I checked the script using the check mark it says it has no errors, but when I try to auto format it, it tells me that it does.

                Any thoughts.

                Thank you again.

                JR
                • 5. Re: Playing multiple FLV files with actionscript 2.0
                  Greg Dove Level 4
                  The autoformatting is (I think) just because I had comments inside the array ( the playList).

                  Hang on, I'll test it locally.
                  • 6. Re: Playing multiple FLV files with actionscript 2.0
                    Greg Dove Level 4
                    No, it seems to work fine for me, with or without the autoformatting errors ( I get those ocassionally where syntax is fine but autoformatting doesn't work and its due to my poor commenting habits).

                    As an additional check, you should make sure that you have the updated FLVPlayback component installed. There was an updated version released middle of last year which fixed a couple of bugs.

                    Also, its probably best to put this line before the first play:
                    tvset.bufferTime = 10;

                    i.e. before:
                    tvset.play(playList[currentFLV]);
                    • 7. Re: Playing multiple FLV files with actionscript 2.0
                      Greg Dove Level 4
                      You said it already worked earlier, so this shouldn't be an issue, but make sure your FLVPlayback instance is named tvset in the property panel, i.e. that you haven't changed its name.
                      • 8. Re: Playing multiple FLV files with actionscript 2.0
                        scriptheadache Level 1
                        Dear GWD,

                        Well, you did it. I though I had performed these updates because they were sitting on my drive, but I guess I didn't. So I performed the update and the script plays perfectly. Thank you very much. And thanks for your patience.

                        I am assuming that I just need to add more http lines to the play list to have fun? Anyway, I think it's time for me to explore some learning tools on action script. If you can think of any resources for learning action script please feel free to direct me into the right direction.

                        Thank you again for your help.

                        JR
                        • 9. Re: Playing multiple FLV files with actionscript 2.0
                          Greg Dove Level 4
                          You're welcome, and yes, just add clips to the array to play them in sequence.

                          If you want something else to happen when they've all played, then call a function in the part of the code with the comments that say:
                          //last one has finished playing
                          //do something else here

                          I don't have any one source that I go to learn stuff (I'm still learning too). But I use google a lot. There are plenty of free tutorials online, and I'm sure there are very good paid tutorials as well, but I haven't done any so can't say. I can't suggest one particular source for learning actionscript- my general source was and still is livedocs! Others may have better suggestions.
                          If you have questions about learning a specific actionscript topic, and you can't find a useful guide or tutorial by searching, ask a question about where's best to learn it here, someone might be able to point you in the right direction. Also I think its increasingly important to state whether its for actionscript 2.0 or actionscript 3.0 for clarity.
                          • 10. Re: Playing multiple FLV files with actionscript 2.0
                            scriptheadache Level 1
                            Thank you again. Signing off.

                            JR