. So I'd
say that some kind of check would be useful.
Karina
-Original Message-
From: Scott Hyndman [mailto:[EMAIL PROTECTED]
Sent: 25 August 2006 02:59
To: Flashcoders mailing list
Subject: Re: [Flashcoders] clone object
If you had one circular reference, you'd hit the recursion
you'd need some way of checking for circular references like Scott pointed
out. Believe me when I say - i've been down that road several times with
Xray.
var obj = new Object();
obj.prop1 = new Object();
obj.prop1.prop2 = new Object();
obj.prop1.prop2.ref = obj.prop1;
bingo, you'e into 256
Guess there's a first time for everything, eh?
var obj = new Object();
obj.prop1 = new Object();
obj.prop1.prop2 = new Object();
obj.prop1.prop2.ref = obj.prop1;
function clone(obj:Object):Object
{
var o = (null != obj.length) ? [] : {};
for (var i in obj)
{
o [i] = (typeof
mailing list
Subject: Re: [Flashcoders] clone object
Guess there's a first time for everything, eh?
var obj = new Object();
obj.prop1 = new Object();
obj.prop1.prop2 = new Object();
obj.prop1.prop2.ref = obj.prop1;
function clone(obj:Object):Object
{
var o = (null != obj.length
To: Flashcoders mailing list
Subject: Re: [Flashcoders] clone object
Guess there's a first time for everything, eh?
var obj = new Object();
obj.prop1 = new Object();
obj.prop1.prop2 = new Object();
obj.prop1.prop2.ref = obj.prop1;
function clone(obj:Object):Object
{
var o = (null
Grden
Sent: Friday, August 25, 2006 6:37 AM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] clone object
Guess there's a first time for everything, eh?
var obj = new Object();
obj.prop1 = new Object();
obj.prop1.prop2 = new Object();
obj.prop1.prop2.ref = obj.prop1;
function
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of John Grden
Sent: Friday, August 25, 2006 3:06 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] clone object
I guess you'd be right about that. It'd be my problem - good point.
while I'm
Are you stalking me, Grden? :)
1. I use block comments all the time - but if you think it's janky,
more
power to you.
I have the power of Greyskull. Block comments are for commenting out
*gasp* blocks of code. I use block comments all the time for that very
purpose. I use line comments to
shouldn't you boys be going out and getting a drink on blitz's account
instead of teasing each other like this?
On 8/25/06, Steven Sacks | BLITZ [EMAIL PROTECTED] wrote:
Are you stalking me, Grden? :)
1. I use block comments all the time - but if you think it's janky,
more
power to you.
LOL I seriously think you may end up in a padded room with a box of crayons
;)
OK, we're officiall OT - sorry mods!
we're ending it here.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
I'm not working for blitz at the moment ;)
On 8/25/06, Johannes Nel [EMAIL PROTECTED] wrote:
shouldn't you boys be going out and getting a drink on blitz's account
instead of teasing each other like this?
___
Flashcoders@chattyfig.figleaf.com
To
I'm not working for blitz at the moment ;)
Me neither while this keeps up! ;)
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you
Careful with circular references. Pretty easy to get that one in to
exceed the 256 recursion limit.
Scott
On 23/08/06, Steven Sacks | BLITZ [EMAIL PROTECTED] wrote:
static function clone(obj:Object):Object {
var o = (null != obj.length) ? [] : {};
for (var i in obj) {
Careful with circular references. Pretty easy to get that one in to
exceed the 256 recursion limit.
Feel free to post an alternative. :)
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
I would mark each object (by actually assigning the cloned object as a
property of the original) as I go through each individual clone
operation, and keep a running array of what is being marked. If I hit
something that is already marked, I will use the clone instead of
copying the same object
If you're not willing to code a solution, then why are you bothering to
write out an explanation? I have yet to encounter a recursion limit and
I've parsed some deep object models.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription
If you had one circular reference, you'd hit the recursion limit.
On 24/08/06, Steven Sacks | BLITZ [EMAIL PROTECTED] wrote:
If you're not willing to code a solution, then why are you bothering to
write out an explanation? I have yet to encounter a recursion limit and
I've parsed some deep
I have a style that I need to duplicate for several buttons. The style is
declared once and then I want to duplicate the object and add a specific
style element and then apply it to the button. However when I duplicate the
object I get a reference to the original object, as expected. I tried to
You know about mx.utils.ObjectCopy, right?
Be sure to change the following lines to read accordingly:
// var result:Object = new Function( refObj.__proto__.constructor)();
//change to:
var result:Object = new (Function( refObj.__proto__.constructor))();
and
// p[j]= q[j];
static function clone(obj:Object):Object {
var o = (null != obj.length) ? [] : {};
for (var i in obj) {
o [i] = (typeof obj[i] == object) ? clone(obj[i]) :
obj[i];
}
return o;
}
___
20 matches
Mail list logo