Seems like using a singleton is a good way to load the xml only once. Calling getInstance() will return the info you need each time. The getInstance function can be static.
Norm -----Original Message----- From: Alan Watts [mailto:[EMAIL PROTECTED] Sent: Thursday, September 13, 2007 6:47 PM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] static vs singleton hi all, I have a model class that contains xml data for a file I am manipulating. What would be the difference between setting it up as a singleton and just accessing it via static vars and methods? myFile.load(<file name='oldName'....); myFile.setFileName('NewFileName'); with the class containing something like: package { public class myFile extends Object { private static var xml:XML; public static function load(fileXML:String):void { ... xml=fileXML; } public static function setFileName(fileName:String):void { [EMAIL PROTECTED] fileName; } } } This approach works fine, but I haven't used AS3 enough to know if this is an obvious memory problem. But it seems more logical than doing: new myFile(); myFile.getInstance().setFilename()... etc. Thanks! Alan _______________________________________________ Flashcoders@chattyfig.figleaf.com 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