Whittled it down to 1 line of code that basically does the following in the 
RSO's onSync:
- get object from array on RSO
- add object a new array bound to datagrid

Apparently, that object is being copied by reference from the RSO to the new 
array, thus causing an onSync to occur on the RSO, and since this data 
exchange happens in the onSync, it is recursive.

Doing a for in loop on the object, and copying the primitive string 
properties to a new object, and then putting THAT copy in the array fixes 
the problem.

...another use case for Object.deepClone()...

----- Original Message ----- 
From: "JesterXL" <[EMAIL PROTECTED]>
To: "Flexcoders" <[email protected]>
Sent: Sunday, September 18, 2005 2:31 PM
Subject: [flexcoders] DataGrid, Binding, & Flashcom


The short, I've bound a DataGrid to an array.  When a Remote SharedObject
updates, I removeAll on the local array the dg is bound too, loop through
the array on the so.data pulling objects off and putting them into the local
array; this way I'm not bound to an so directly since there are a multitude
of slots.

This works good.  What doesn't work is opening a new instance of my app; I
think when the DataGrid is initialized in the new instance, (new tab in
Firefox), my local array is initailzed (feats_array = []) and it's binding
does something to the array; I'm not sure what, but somehow, even though I
THOUGHT I was cleary seperating the local array from the RSO, I guess I'm
not because it goes in a loop of modifying a slot on the RSO, and I keep
getting onSyncs forever.

My only guess is the object I'm pulling off, even though it's a local var in
the for loop, is somehow keeping a referencing or something, and triggering
a dirty flag on the RSO when the DataGrid's binding is initialized.

Any clues/hints for me to try to track down?

--JesterXL




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links








------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to