Preloader for dynamic xml text. how?

Hi,

Im creating a news section for my project where i have a swf in which ill load xml text (news…ie site updates) is it possible to have a preloader there ? or it loads reeally fast and no need for it ?

note. im gonna embed pixel font.

any idea…link that helps …appriciated
thx

Do you want a preloader for the XML or the entire SWF?

just for the xml …

also if its easy…which is the best method to load simple xml file (text…and propably a tiny thumbnail pic) ?

thx canadian

do we need a seperate preloader for loading xml too. cannt we have it all in one with the movie itself :ponder:

yea…but since xml load dynamic…i guess we do need …especially when u have a long block of text (xml)

Here’s how I’d do it:

mx.transitions.OnEnterFrameBeacon.init();
var x:XML = new XML();
x.ignoreWhite = true;
x.load("some.xml");
MovieClip.addListener(x);
x.onEnterFrame = function():Void  {
 //ratio between bytes loaded and total bytes of the XML file
 var perunus:Number = this.getBytesLoaded() / this.getBytesTotal();
};
x.onLoad = function(success:Boolean):Void  {
 if (success) {
  delete this.onEnterFrame;
  //code for if XML loads properly
 } else {
  //code for if XML does not load
 }
};