Click to See Complete Forum and Search --> : Loading largeish xml files

07-09-2001, 07:28 PM
Hi all,

I've built a standalone projector that loads in text for a presentation engine through local xml files.
It's quite a lot of text, but each section is split into it's own xml document the largest being about 70k.

This works fine off a CD, but my idea was to build the projector and then also put a swf up on the net, and so save having to essentially do the same thing twice.

The problem is the lag seems to be messing up my movie, as it can't load the xml quick enough for the online version.
Do I need to create a socket connection for this, or is there something i'm missing about loading xml in.
I thought the xml.load method was supposed to only execute onload when it had finished getting the whole document...

Any help appreciated.


07-09-2001, 07:43 PM
I'm going to assume that by 'lag' you mean that Flash stops everything until the XML has fully loaded - right??

... and that's your problem right now... right?

07-09-2001, 08:31 PM
well sort of, what happens is when a button is clicked to load a section it'll take a while to do anything, that's fair enough. But it also fails to actually load some stuff.
For example, as well as the text for a section, the xml docs contain specs for a nav menu for each section.
The nav menu then build's itself on these specs.
Online however, the nav menu either fails to build at all, or still shows the links from the previous section, which shouldn't be there anymore.

i.e. the main section buttons each create an xml object called "section", and load their xml file into it when clicked (they all call the same creation function, but load different xml into the object).
So that means that what was previously in the xml object "section" is destroyed because the object has been recreated...right??
So why is some stuff still there?

I'm starting to think this is more to do with the timing in my code, and that I should make a few things wait a bit longer before they run...

just trying to explain this is helpful anyway !!

thanks for your time
[Edited by SJT on 07-09-2001 at 08:34 PM]

07-09-2001, 08:56 PM
You're kinda scarin' me with this part about having to 'time' your loading differently or something.. you shouldn't attempt to deal with the XML object until it has completely loaded.

You'll want to use either onLoad - or loaded to check the first part, then status to double check.

07-09-2001, 09:14 PM
That's the problem;
I DO use onLoad but it's like it hasn't loaded the xml, even though it's executing stuff that's part of the onLoad statement.

function getMypage (me) {
section = new XML();
section.onload = sectionLoaded;

07-09-2001, 09:23 PM
not sure what happened to the last bit of me previous post...it seems to have been clipped.

anyhow, thanks for your help VAYKENT, i've sorted it now, had a closer look at my onload statment; the stuff that isn't working isn't part of the onload statment, it's just placed after it. seems it gets executed even though onload hasn't finished loading yet...stupid coding mistake in other words.

Ta for the v quick responses!!

07-09-2001, 09:26 PM