Makes total sense! Valuable info for the rare occasion I do a Director/Flash hybrid. Thanks for indulging me. :)
-tom -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Danny Kodicek Sent: Thursday, June 01, 2006 2:26 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] create an object of type defined with a string > Danny, > > Out of curiosity, why do you need a function that returns an object of a > type passed as a string? It's a neat idea, but I'm scratching my head as to > where one might apply it. I've been hitting some memory problems when using Director's newObject() function, which creates a new object inside an embedded Swf. Because the object is unnamed, I have no way to destroy it in the Flash movie - it seems to go somewhere in the global space. So instead, I'm making my own tempObject function, which creates a new object in an array pTempObjects in the Flash movie. When I've finished working with it, I run a clearTempObjects() function to flush them out. So I have this function: function tempObject(tName:String) { var tObj:Object = <new Object of type tName> pTempObjects.push(tObj) return tObj } Now Director can call this function, get a new temporary Flash object and work on it, then tell Flash to do something with the object (eg, setting the properties of a TextFormat object before applying it to a field), and then finally clear it out. More detail than I think you wanted, but since you asked :) Danny _______________________________________________ [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

