2 Replies Latest reply on Jun 10, 2008 6:02 AM by enrique_rodriguez

    Loading Bar managing multiples netthings

    enrique_rodriguez
      Hi friends. It's been a while.

      I working on a project that parses multiples XML and image files. The first XML (initial data file, idf.xml) contains a serie of nodes, for example:
      example of idf.xml
      <data><file_name>"data.xml"</file_name></data>
      <prefs><file_name>"preferences.xml"</file_name></prefs>
      ....
      I use a sequential preloadnetthing with every node founded in idf.xml, for each file I use streamstatus to track downloading progress. What I want is to track the progress of the entire package (data.xml + preferences.xml). That is, to know the filesize of every xml before the first call of streamstatus.

      One aproach is to store the filesize of each file in the idf.xml as:

      <data><file_name>"data.xml"</file_name><file_size>27676</file_size></data>

      So when I parse the file I know the data.xml + preferences.xml file size and use it as a 100% value.
      I don´t like this solution, It works, but I don' t like it.

      There is another way to achieve that?, I would appreciate any sugestions.

      Best Regards.
        • 1. Re: Loading Bar managing multiples netthings
          Level 7
          enrique_rodriguez wrote:
          > I working on a project that parses multiples XML and image files. The
          > first XML (initial data file, idf.xml) contains a serie of nodes, for
          > example: example of idf.xml
          > <data><file_name>"data.xml"</file_name></data>
          > <prefs><file_name>"preferences.xml"</file_name></prefs>
          > ....
          > I use a sequential preloadnetthing with every node founded in
          > idf.xml, for each file I use streamstatus to track downloading
          > progress. What I want is to track the progress of the entire package
          > (data.xml + preferences.xml). That is, to know the filesize of every
          > xml before the first call of streamstatus.

          Can you use streamSize?

          (And do the filenames really need quotes around them?)

          Andrew


          • 2. Re: Loading Bar managing multiples netthings
            enrique_rodriguez Level 1
            I Can't test it now. But I think I can't, when I preloadnetthing with a XML I have no cast member to access to its streamsize prop.

            Do I need to import it in a cast member as "link to external file" and then preload it?. This can be done, however, there are image files that changes in filenames and number, so I have the problem again.

            Thanks for the reply, the problem is that I didn´t explain what do the program do with the files.

            For XMLs:

            Preload
            Use it (populate a proplist)
            forget it

            For Images:
            preload it
            create a new #bitmap cast member
            import the image to the member with importFileInto
            Create a new 3d texture with the member.
            don' t forget it until program closes.

            The xml is the simplest case, in fact I can put the filesize in the firs XML (initial data file), But the image files are more complex ( or tedious)

            For the double quotes, I made a maxcript XML scene exporter that gave me problems with some file names. I think It was the & character. So I enclosed file names with quotes as a fast solution. Maybe I must define a DTD for the XML (well, another story for that).