8 Replies Latest reply on Jun 19, 2007 8:26 AM by Greg Dove

    FLV Playback - Player 8

    o0ospaceboyo0o
      Hello everyone, Thank you for reading this. I have come across a huge project that includes action script and an XML file which I have no knowledge of. I want to learn and hopefully this will help a lot of others who might have the same questions as well. So that I don't have to write the whole thing over again which is a lot I will include a link to where the thread originates from. Please, anybody who reads this, read the forum and maybe you can assist me in this painful journey. Thank you again.


      original thread - kirupa.com
        • 1. Re: FLV Playback - Player 8
          Greg Dove Level 4
          If you have a specific question I'm happy to try to answer it.
          I've done similar things to that with FLVPlayback and XML 'content definitions' and I found that its much easier to use XPathAPI for reading all the nodes to start with for example.
          • 2. Re: FLV Playback - Player 8
            o0ospaceboyo0o Level 1
            GWD, my deepest gratitude for replying. So you think using XPathAPI for reading all the nodes would be easier? If you followed the original thread; we got to a point where karalee wrote a code for me to plug in to flash so that we could load up the XML file which is also available on the thread. Could you possibly take a look at the code which she wrote and tell me what you think? Could I possible get this to function with that code or should I start fresh using XPathAPI. If you notice I'm a mere beginner with absolutly no development background so all the help I can get is greatly appreciated. Thank you for you time and effort.
            • 3. FLV Playback - Player 8
              Greg Dove Level 4
              Sorry - it was a long thread and I didn't read all of it...but to answer your question about XPathAPI:
              I think that if you're still working on/defining the format of the xml that you're using to define the presentation and content of the "enhanced" video player then using XPathAPI is a good idea. Why: because to a degree it can allow you to change parts of the structure and sequence of nodes if you need to without you having to redo lots of existing code. If you're happy with what you have and how it works then stick with that. FYI XPathAPI lets you select (for example) groups of nodes by their names in a more intuitive way than using things like:

              xmlNode.firstChild.childNodes[1].firstChild.nodeValue

              which is how its done at the moment.

              (XPathAPI may not actually save typing but its much easier to read than that line above!)

              If, as you say, you're a beginner... then this is probably a very challenging project to start with... it may be helpful for you to do some tutorials for example in areas where you feel you need to understand more... using FLVPlayback or using external XML files for different things ... and perhaps using XPathAPI ( its easy once you get used to it - but the Adobe documentation is very light). Your goal (if you want to improve your understanding) should be to arrive at a point where you feel you have built the thing yourself or at least most of it. In order to do that you should have a baseline understanding of the separate bits (FLVPlayback, XML) and how you put them together.
              • 4. Re: FLV Playback - Player 8
                o0ospaceboyo0o Level 1
                Thanks again for you advice. Do you know where I can go to get professional help in accomplishing this player? A consultant or a website; to take over what I've begun? I have a deadline and I've tried to do it myself but it will take too long.
                • 5. Re: FLV Playback - Player 8
                  Greg Dove Level 4
                  I'm sure there are developers out there that could help you - you could try one of the freelance sites or forums perhaps.
                  • 6. Re: FLV Playback - Player 8
                    mohsang
                    import com.xfactorstudio.xml.xpath.*;
                    var myXml:XML = new XML(xml_txt.text);
                    myXml.ignoreWhite = true;
                    onMouseUp = function () {
                    trace(XPath.selectNodes(myXml, "/products/product[./price > 4.95]"));
                    };

                    XML
                    -----
                    <products>
                    <product SKU="7123734">
                    <name>Big Metal Pot</name>
                    <price>19.95</price>
                    </product>
                    <product SKU="752585">
                    <name>Plate</name>
                    <price>12.95</price>
                    </product>
                    <product SKU="4182476">
                    <name>Spoon</name>
                    <price>4.95</price>
                    </product>
                    </products>
                    • 7. Re: FLV Playback - Player 8
                      o0ospaceboyo0o Level 1
                      quote:

                      Originally posted by: mohsang
                      import com.xfactorstudio.xml.xpath.*;
                      var myXml:XML = new XML(xml_txt.text);
                      myXml.ignoreWhite = true;
                      onMouseUp = function () {
                      trace(XPath.selectNodes(myXml, "/products/product[./price > 4.95]"));
                      };

                      XML
                      -----
                      <products>
                      <product SKU="7123734">
                      <name>Big Metal Pot</name>
                      <price>19.95</price>
                      </product>
                      <product SKU="752585">
                      <name>Plate</name>
                      <price>12.95</price>
                      </product>
                      <product SKU="4182476">
                      <name>Spoon</name>
                      <price>4.95</price>
                      </product>
                      </products>



                      Thanks mohsang for the example. Is this an example of using the method which GWD told me about (XPathAPI)? If I'm write then I think I'm on the right path. I will grab my XML and try to mirror what he has done but with my nodes. Any advice?

                      GWD- can you please take a look below and see if this way is correct; I apologize for telling you to read my whole forum that was just silly of me. Maybe when I place my XML and the code which I already have you can give me some pointers on finishing it up from where I left off. I figure that since this is such a challenge to begin with, I have to do all that I can to continue with what I have because time is not on my side and then if it's too hard to do it this way then I'll try to use XPathAPI. Thanks :)



                      • 8. Re: FLV Playback - Player 8
                        Greg Dove Level 4
                        OK. Some quick feedback.

                        First.. the example/sample code mentioned by mohsang was with another XPathAPI implementation from xfactorstudio. (Most people say its better than the Adobe/macromedia one because its more comprehensive - but the principle in terms of using it over the regular XMLNode access methods is the same)

                        Second.
                        All your code appears to do is read the xml and place its values into local variables - these variables happen to be initialised as empty arrays. One advantage with using XpathAPI is that its easier to avoid the need for this and just use the xml directly - I tend to do that more now.

                        At the moment it appears to loop through the root childnodes - which in your case is only one (the <config> node). So I believe all your arrays would be assigned a single element which corresponds to the text node (nodeValue) in the xml. There are easier ways to do it than you have done... but if that's what you want to achieve then I guess what you have should work. I haven't checked the code to see if each path to the textnode nodeValue in actionscript corresponds to your actual xml... sorry I won't be able to do that for you...

                        What seems to be missing is what comes next. All you have is the data. You need to do something with it.

                        If you have none of that code already then my suggestion is that you were correct earlier. You will undoubtedly get this done faster if you pay someone who has the time and knowledge to do it quickly.