dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: XML Preloader

  1. #1
    Junior Member
    Join Date
    Jun 2004
    Posts
    22

    XML Preloader

    Hi,

    I want to build a preloader for my xml objects, but the way that macromedia help tells just doesn't work.
    Is there any secret behind it?I think i read anywhere that it depends from the server, although that could be true it would work in test mode, woun't it??


    thanks in advance

  2. #2
    Junior Member
    Join Date
    Jun 2004
    Posts
    22

    My code

    here is the code i use:

    my_xml=new XML();
    my_xml.ignoreWhite=true;
    my_xml.onLoad=carregado;
    my_xml.load("file.xml");
    xml=Math.round(my_xml.getBytesLoaded()/my_xml.getBytesTotal()*100);

    and the output is NaN, not a number.

  3. #3
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    i believe that you will have to overcome two obsticles for the preloader:

    1) Especially if you are loading of disk or using the flash player (debug mode) you will not get any data for the preloader as the XML data is loaded instantly.

    2) When using a plugin the XML data needs to be in a static file. If the data is being generated by a script most of the time the script will not tell the server how big the content is. This means that the server will not know how big the XML file is until the script has finished sending it. I know a few of the scripting languages have the option of specifying the size of the file before it is sent to the server.

    Thanks

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

  4. #4
    Junior Member
    Join Date
    Jun 2004
    Posts
    22
    Hi,

    1)I think that if i customise the download time i will see the getBytesLoading working in debug mode

    2)The data is not generated by a script, it is loaded from a xml file.

  5. #5
    Junior Member
    Join Date
    Jun 2004
    Posts
    22
    Are there any ideas how to create a xml pre-loader.I realy need it, cause i have a xml menu in my site and my site loads faster than it!!

    Thanks in advance

  6. #6
    Senior Member stoc's Avatar
    Join Date
    Nov 2001
    Location
    Romania, Arad
    Posts
    428
    are you sure your xml file is correct formated?!

    is it contains
    code:

    <?xml version="1.0" encoding="iso-8859-1"?>


    !?

    As I remember I had this problem in the past, and Im not sure , but I think this one solve my problem !
    Stoc Digital Studio - Web Applications Development
    http://www.stoc-studio.ro

  7. #7
    Junior Member
    Join Date
    Jun 2004
    Posts
    22
    Hi,

    My xml file is already correctly formated and it doesn´t work.I really don't know what is missing.Could you post one of your examples about it?

  8. #8
    Junior Member
    Join Date
    Nov 2000
    Posts
    15
    I found that
    PHP Code:
    <?xml version="1.0" encoding="iso-8859-1"?>
    caused me problems and ended up stripping this out as flash didn't need this to work with the xml.

  9. #9
    Junior Member
    Join Date
    Jun 2004
    Posts
    22
    Thanks for your help,

    but it doesn't work with me!Could you post an example of the actionscript you use?

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