Better way is you can use the recursion, If your XML files follows same tags.
As below:-
> ..........................................................................
> 1.. var myParameters:XML = new XML();
> 2.. myParametersignoreWhite = true;
> 3.. myParameters.onLoad = function(success)
> 4.. {
> 5.. if ( success)
> 6.. {
> 7.. // get the Paramenters from myParameters
> 8.. // begin reading other XML files
> 9.. // wait for them to succed
myParameters.load("Other XML file");
> 10.. // start app
> 11.. }
> 12.. };
> 13.. myParameters.load("parameters.xml");
> ..........................................................................
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of eric dolecki
Sent: Wednesday, June 07, 2006 4:54 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] callBack for Beginners ?
you could daisy-chain function calls when xml documents get their onLoad(
success:Boolean)... that would work pretty well.
On 6/7/06, jcarlos <[EMAIL PROTECTED]> wrote:
>
> Hi All,
>
> I need help
>
> I trying to develop some small app that read a Parameters list from a XML
> file and then if succeded, read other XML files as specified by the
> Parameters file and only after these files were read and succeed the app
> would start, what is usually get with something like this
>
> ..........................................................................
> 1.. var myParameters:XML = new XML();
> 2.. myParametersignoreWhite = true;
> 3.. myParameters.onLoad = function(success)
> 4.. {
> 5.. if ( success)
> 6.. {
> 7.. // get the Paramenters from myParameters
> 8.. // begin reading other XML files
> 9.. // wait for them to succed
> 10.. // start app
> 11.. }
> 12.. };
> 13.. myParameters.load("parameters.xml");
> ....................................................................
>
> but I´m guessing how to do it in a clean way, because after some files it
> gets messy and hard to read and mantain,
>
> how could I make each XML loading dispatch some special event after it
> succed to the main app and only after all events of all files occurred it
> would start it ??
>
> Should the main app be implemented as some kind of OBSERVER pattern where
> it stays listening to these events ?
>
> João Carlos
> Rio Brazil
> _______________________________________________
> [email protected]
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com