You want a for..in loop, NOT for...each:

var newDict:Dictionary = new Dictionary();
var item:Object;  //don't think you want Class type, here..
for (item in myDictionary) {
   //now perform the deep copy...
   //for which you may need to have the class def...
    newDict[item] = ObjectUtil.copy(myDictionary[item]);
}

see:

http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001880.html

Basically, for-in: keys. for-each: values

- Scott

On Nov 30, 2007 9:30 AM, polestar11 <[EMAIL PROTECTED]> wrote:

>   --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, "
> ben.clinkinbeard"
>
> <[EMAIL PROTECTED]> wrote:
> >
> > > it only copies over object values, not exact values.
> >
> > Huh?
> >
> >
>
> @Tom
> How would one bind the keys to the new dictionary children?
> var newDict:Dictionary = new Dictionary();
> var item:Class
> for each(item in myDictionary) {
> newDict[?] = item;
> }
>
> @ben
> If I have an object containing types (in my case a collection of Class
> types referenced by a key string). Using the ObjectProxy.copy(), the
> new object will contain child objects with the same keys as the
> original, but the child types are Object types, not Class types.
>
>  
>

Reply via email to