4 Replies Latest reply on Oct 9, 2006 3:18 AM by this.sonix

    Preloading

    this.sonix
      Hi everyone
      I have an Application which uses Data from a local XML-File and I'm loading the Data with:
      <mx:HTTPService url="Preise.xml" id="prices" result="XMLHandler(event)" showBusyCursor="true"/>

      My XML-File will have 90MB, so I want to preload the XML-File while loading the Application or preload it after the Application startet up.

      Is it possible to write a Preloader which preloads the Data from the XML File ?
        • 1. Re: Preloading
          peterent Level 2
          In order to load the XML you need to have some application code loaded. So you'd be trying to load the data before the code was available to load the data. So it is not possible to preload the data.

          90Mb is quite a lot download - no matter what you are using for client-side UI. 90Mb is 90Mb, no way around it. When you data set is that large it is time to look into Flex Data Services and Flex Data Management.
          • 2. Re: Preloading
            this.sonix Level 1
            My Problem is that I cant use Flex Data Services or some Webservice to load the data from a database because the Application should be runnable from a CD on every machine who has FlashPlayer installed.

            When Flex loads my reduced XML File (1.5 MB) it is working fine, but with a File of about 100Mb i'll get a Error Message that the max Script execution time of 30 seconds is up ... and firefox does no longer work.

            The time which the application needs to load the file does not matter, I only have Flex to load this "King-Size"-XML File, Anyhow.

            Is there perhaps another possibility to load an XML File an use the date in a DataGrid, except HTTPService ?

            THX
            • 3. Re: Preloading
              peterent Level 2
              If you are running from a CD, then you could embed the XML into the SWF:

              <mx:XML id="myData" source="myData.xml" />

              This incorporates the XML into the SWF so there's no download or reading of the data - its just there. It does increase the size of the SWF of course, but when loading from a CD and not from the 'net, it might work for you.
              • 4. Re: Preloading
                this.sonix Level 1
                Thank you very much !