|
instanceof : never seen that before...very nice
:)
Bill Lane
>>> [EMAIL PROTECTED] 07/20/05 10:45 am >>> What if the object is an array or contains an array? //========================== //Revised clone v2: function clone(o1:Object) { if (typeof(o1) == "object") { if (o1 instanceof array) { var o2:Array = new Array(); for (var i=0;i <o1.length();i++) { o2[i] = clone(o1[i]); } } else { var o2:Object = new Object(); for (var i in o1) { o2[i] = clone(o1[i]); } } } else { return o1; } } Chris -- Chris Velevitch Manager - Sydney Flash Developers Group www.flashdev.org.au --- You are currently subscribed to fugli as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/ You are currently subscribed to fugli as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/ |
- [fugli] Re: clone object Chris Velevitch
- [fugli] Re: clone object Bill Lane
- [fugli] Re: clone object barry.b
- [fugli] Re: clone object Sebastian Porto
- [fugli] Re: clone object Bill Lane
- [fugli] Re: clone object barry.b
- [fugli] Re: clone object Chris Velevitch
- [fugli] Re: clone object Bill Lane
- [fugli] Re: clone object Chris Velevitch
- [fugli] Re: clone object Mike Pearce
