Jump to content
Search Community

workflow for reloading xml

idahotallpaul test
Moderator Tag

Recommended Posts

Hi.

 

I'm building a kiosk application that needs to reload a piece of xml data every 3 minutes to update a realtime chart. I obviously want to make sure that the xml data is not being cached by the browser and want to make sure that everything is being garbage collected.

 

What is the recommended workflow for this? Is it best to create a new XMLLoader each time I'm fetching the new data and pass it the autoDispose parameter? Or can I create one XMLLoader, pass it a noCache parameter, and call _myXMLLoader.load () on interval?

 

If there's a bit of sample code you could point me to, I'd appreciate it.

 

Thanks all, and thanks Jack for making my life easier. :)

Link to comment
Share on other sites

I imagine creating a single XMLLoader and calling load with no cache on, and set flushContent to true:

 

// load(flushContent:Boolean = false):void 
xmlLoader.load(true); // to flush previous content

 

That way you create one XMLLoader object, and reuse it for the duration of the application. Should create the smallest memory footprint.

Link to comment
Share on other sites

Thanks for the input. I ended up creating one loader, and then on interval, I'm calling the .unload () function and then .load ().

 

_xmlLoader = new XMLLoader("../xml/usage.xml", {name:"chartXML", noCache:true, autoDispose:false, onComplete:completeHandler});
_xmlLoader.load();

// later, on my timer interval:
_xmlLoader.unload();
_xmlLoader.load();

 

Does _xmlLoader.load (true) do the same thing, or are they different in any way?

 

Thanks.

Link to comment
Share on other sites

Does _xmlLoader.load (true) do the same thing, or are they different in any way?

Both methods call the internal method _dump(1, LoaderStatus.READY); - so they're doing the same thing. (See LoaderCore.as line 170, and line 273)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...