A Flash Developer Resource Site

Results 1 to 18 of 18

Thread: Why my xml data is not complete?

  1. #1
    Junior Member
    Join Date
    Dec 2003
    Posts
    10

    Why my xml data is not complete?

    Hi Flash World,

    I'm in a big problem. I'm doing a project that calls a php file with this:

    XMLdoc="myphp.php"

    XMLobj = new XML();
    XMLobj.load(XMLdoc);
    XMLobj.ignoreWhite = true;
    XMLobj.onLoad = parseXML;

    when the xml file is returned it's cut and I only have 12 xml items, but if I call "myphp.php" from my a browser it shows ALL the xml items.... how is it possible? why the returned file is cut? have the load function some kind of limitation?

    Here is the important part of my php code too....

    echo "<?xml version='1.0' encoding='UTF-8'?>";
    echo "<TEXTS>";

    while($fila = mysql_fetch_array($rs)) {

    $id = parsea_paflash($fila["id"]);
    $nombre = parsea_paflash($fila["nombre"]);
    $titulo = parsea_paflash($fila["titulo"]);
    $texto = parsea_paflash($fila["texto"]);
    $foto = parsea_paflash($fila["foto"]);

    $xmlTxt = "<";
    $xmlTxt .= 'TXT NOMBRE="'.$nombre.'" ';
    $xmlTxt .= 'ID="'.$id.'" ';
    $xmlTxt .= 'TEXTO="'.$texto.'" ';
    $xmlTxt .= 'TITULO="'.$titulo.'" ';
    $xmlTxt .= 'FOTO="'.$foto.'" />';

    echo $xmlTxt;

    }
    echo "</TEXTS>";


    Thank you for your time!!!

    Dani

  2. #2
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    There is no limit to the number of XML nodes that flash will parse (way back when we did tests with 1000's of nodes).

    Just wondering if you open the xml file in internet explorer does it color code the XML for you?

    This is a sign that the XML can parsed correctly.

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  3. #3
    Junior Member
    Join Date
    Dec 2003
    Posts
    10
    Yes it does.... in IE I can see all xml file with coloured tags and I'm able to expand them... as a normal xml file.


    Thank you!!

  4. #4
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    what happens if you put a statement saying:

    trace(this)

    in your parseXML function? Is it displayed there with the missing data, file cut in half etc?

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  5. #5
    Junior Member
    Join Date
    Dec 2003
    Posts
    10
    when I've done trace I can see only a part of the file, but the closing tag is there too.... so it seems as if that is the returned data from the php file.... but, as I've alrady said, if I try that call through my browser I get the whole file....

    Thank you for your help!

  6. #6
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    Is it possible to get a link to your XML file to see if I can see what the problem is?

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  7. #7
    hi guys, i know this thread is old but i found it with the search engine.

    I have exactly the same problem, I load an XML file (from a VB aplication using the http://localhost as URL address) and when the onLoad function is executed the xml loaded shows part of the data, but well formated, with the last main tag closed!

    I noticed that it only happens with big xml files (40 - 50Kb) and not every time i call the xml, sometimes it works fine.
    I dont know how to fix it because there is no code to modify!!! it is the flash event "onLoad" who fails i think.

    please if someone found a solution let me know.
    thanks a lot.

  8. #8
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    There is a XML.onData event:

    http://www.macromedia.com/support/fl...ionary849.html

    This will let you see the raw source of the file. Is your main tag being closed at this point or is flash adding something?

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  9. #9
    Junior Member
    Join Date
    Dec 2003
    Posts
    10

    I solved this problem... solution follows

    Hi Flash world,

    I had this problem a long time ago and I remember that I wrote here this question.

    I tried different ways to do it but always the data that I was receiving inside flash was cut in some part. I looked character by character and I found that this problem is a parsing between Flash and the HTML - Ascii value of some characters.

    I had to create a function to parse all the special characters that I had problems with and I had to send to the flash movie from my php code the characters already parsed and then I had the whole string when I tried to trace the content that I was receiving inside the flash movie.

    I hope it helps you out but take a look at the place where the xml string is being cut and open the xml to look what kind of special character is creating the problem.

    Thanks to all of you because you helped me out more than once!

  10. #10
    hi guys,

    tupps,
    i will try with the onData event.


    danhin76,
    i had this problem once, some characters like "" or "" gave me some problems with the xml (i speack spanish so those are common characters to me).

    To fix the problem with the special chars i used the following header in the xml file:
    Code:
    &lt;?xml version='1.0' encoding='iso-8859-1'?&gt;
    and the following code in the flash movie:
    Code:
    System.useCodepage = true;
    then those latin special chars were not a problem anymore.

    But this is a different problem.
    please follow my thread about this problem here:
    http://www.flashkit.com/board/showth...03#post3123003

    thanks in advance!
    Last edited by cbaristo; 11-18-2004 at 09:15 PM.

  11. #11
    Junior Member
    Join Date
    Dec 2003
    Posts
    10
    Hi cbaristo,

    I'm spanish too so I'm used to this kind of characters but the problem was that not all the saved data in the database was in "spanish ascii code" or "english ascii code". Sometimes we found a very weird character as a simple quote or ("comilla simple") that was not even a spanish or english character.

    Those kind of characters where the ones that cut the XML data. As you have done in your sample, it is not important how big a XML file is while it is correctly parsed and not "special characters" for flash.

    I was working in David Bisbal's website and we spent more than one day to find out why the XML data was being cut.

    Special note... I was doing Bisbal's website but I hate that guy and his music ok )))

    Special note 2... you can take a look at www.davidbisbal.com

    I hope it helps but if not.... let me know.

    See you!

  12. #12
    hi danhin76,

    ok, i see the problem with those chars. I understand your solution, I used to use a selfMade function too, to parse the spanish tipical chars "" until i found the code I wrote in the last post.

    But unfortunely I still having no answer for this problem. The XML is parsed ok sometimes and other times is not. So there is no problem with the format. Flash can parse it well, but some times it just doesnt work.

    I dont like the music of Bisbal, I dont even know him until I read your post.

    cya.

  13. #13
    Junior Member
    Join Date
    Dec 2003
    Posts
    10
    I have a question about the source of that data that you want to parse.

    Is it a SQL query and you parse the result?

  14. #14
    Member
    Join Date
    Jul 2001
    Posts
    61

    Flash xml only partially loading

    I've go the same problem and I'm english. My xml contains a menu list starting with a mainmenu element and up to 20 child elements to a maximum of 20 mainmenu nodes. I can load four. I somehow think the xml does not have time to load. I'm really desperate for a solution as I have a CBT to deliver and my menu's aren't functioning . AND THAT IS A PROBLEM!!!

  15. #15
    Junior Member
    Join Date
    Dec 2003
    Posts
    10
    Could you post your XML file? I mean the whole file not the part received in flash.

    Thanks!

  16. #16
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    Is there an Ampersand in your XML?

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  17. #17
    Member
    Join Date
    Jul 2001
    Posts
    61

    XML not loading

    I have a similar problem and reformated my xml to not include any capitilizing of my menu's. It now loads large xml files. What the capitization does to the parsing I have no idea!!!! I've been farting with this for about 10 days.

  18. #18
    Junior Member
    Join Date
    Dec 2003
    Posts
    10
    Always always always this problem about the xml file being cut in flash but not cut directly in the browser has to do with something strange with the characters... Im absolutely sure.

    In my case was some special character, in your case some capital letter had some problem. Whatever it is, it is always in the XML file because if you create a million nodes like this:

    < data >1< /data >
    you will receive the whole file without any problem.

    Trust us flash world...... check your xml files!

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