A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: big xml problem

  1. #1

    big xml problem

    hi guys
    I have read much about this problem in the forum, but I have not found a solution yet.

    Im loading a 50Kb XML file into my flash movie.
    Sometimes it loads fine, and other times it loads only a partial data from the xml. And this partial data changes each time.

    when partial data is loaded the xml shows the main tag closed at the end. So flash thinks that the xml is closed, but there is more data in the source xml.

    im loading the xml file from a vb application, but i have read this problem from diferent sources: asp, php,...

    when using .xml files from hard drive there is no problem.

    i have read that flash has no xml size limit, but the problem stills.
    so, may someone please help me and everyone who got this problem and tell us why is it happening and how the hell can we fix it??

    thanks a lot in advance!!
    the problem is killing me!

    see you.

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    ok, this imay sound stupid, but have you tried breaking it in multiple .xml files? like five 10Kb files, loading one after the other?

    gparis

  3. #3
    ___________________
    Join Date
    May 2004
    Posts
    3,174
    possible you're calling the data too early? try establishing a conditional that'll ensure all the data from the source is available to the player before calling your functions - failing that, perhaps even a primitive setInterval or onEnterFrame to just kill time for something ridiculous (a minute), then an onMouseDown to trigger all the functions you'd normally have onLoad or onData, just to see if time's the problem... otherwise, post your code.

  4. #4
    hi guys,
    thanks for posting.

    gparis:
    yes breaking the big xml in multiple smaller xml files will fix the problem. My flash is working embed in a vb application and my client is developing this vb app and this is not a solution for him.
    you can say change your client!! ;P but this is not a solution for me.
    Anyways now it is a personal problem between flash and me and now i need to know why flash do that!

    moagrius:
    ok, i will post a really basic example code and put it online to see the result.

    now im working with the onLoad event, the big problem in case to need some extra time is what time do i need? I will try with something ridiculous like a minute but just to know if the delay time is the problem because once again this is not a real solution for my client.

    I just cant understand why if the onLoad event says that the xml is fully loaded sometimes it is not! I will try with the onData event.

    once again, thanks guys

  5. #5
    well, now i dont know what to think
    i made a small online flash application.
    this application opens an xml from a php file and when the xml is around 70kb, 100kb, 150kb it stills working well. Flash opens it without lose any tag. So, the xml size seems to be not a problem. and then, where is the problem? why in some cases the flash doesnt show the entire xml?

    the app is easy to use.
    just set a xml long and push the button below, flash will ask for a xml to the php, once loaded the app will show it in the textfield called "xmlLoaded". you will see the xml size and you can open it in a browser too.

    you can scroll down the xmlLoaded textfield to see the value of the last tag called "number", if it is lower than the xml long you will find the problem.

    here you have the link:
    http://cbaristo.com/flashkit/xmlProblem.html

    watch out!!
    big xml long numbers will freeze you computer for a while!
    Last edited by cbaristo; 11-18-2004 at 10:50 PM.

  6. #6
    Junior Member
    Join Date
    Dec 2004
    Posts
    1
    Hi,
    Im having the same problem. I have a 3MB XML files, with about 2000 entries.
    I'm using XPath and can retrieve results from user input when the XML file are small. When I put in more entries, then the search becomes slower and a Flash Player pop up windows said that my script is making the program run slowly. If I continue, then I can view the results.

    I have no solutions yet. If I can find a way out, then I can post here. Thanks.

  7. #7
    s3d:designs
    Join Date
    Aug 2001
    Location
    UK
    Posts
    27

    hmm

    strange

    maybe a work around is to use loadVars.sendAndLoad (and then get back the strucutre)

    or set a var at being,and end to check its all loaded.....
    s3d:designs
    Pure Design | Hosting | Support

  8. #8
    havent seen any code here but onsider the following.

    If you load an XML file and want to use the data inside it. _Always_ assign the onLoad event _before_ the actual xmlobject.load ! like this:

    code:

    var xmlObj:XML = new XML();
    objXML.ignoreWhite = true;
    var strURL:String = "http://yourxml.xml";
    xml.onLoad = function(){
    //blah, loop through your XML here and do stuff...
    }
    // NOW we gonna load it
    xml.Load(strURL);



    A too large XML file can indeed make your script run slow. Just because it has to loop trough all of it and that takes time. It shoudn't loose data...

    I used XML with searchindex information. for a prety big site, with lots and lots of information and text. I split all files up in [a-z].xml and had some logic in flash to load only the things it really needs to use and only loads and processes it once.

  9. #9
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Why don't you preload your xml file before parsing it? I had the problem that my xml files were not parsed when I loaded and parsed them using buttons. But when I preloaded I had no problem including speed.
    - The right of the People to create Flash movies shall not be infringed. -

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center