# I still can't get this! Nested dictionaries

**URL:** <https://forum.kirupa.com/t/i-still-cant-get-this-nested-dictionaries/321545>\
**Category:** Uncategorized\
**Created:** [April 22, 2011, 3:26pm UTC](https://forum.kirupa.com/t/i-still-cant-get-this-nested-dictionaries/321545 "2011-04-22T15:26:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![m2244](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@m2244](https://forum.kirupa.com/u/m2244)\
**Post date:** [April 22, 2011, 3:26pm UTC](https://forum.kirupa.com/t/i-still-cant-get-this-nested-dictionaries/321545/1 "2011-04-22T15:26:14Z")

</div>

I’m getting closer. I need (I think) to use nested dictionaries because I need to easily reference the parent and child objects in case the user changes something, it needs to rewrite the entry associated with that object.

I highlighted the code that I am having problems with. Ultimately I need to know what is in the array nested inside of 2 dictionaries.

```auto

var fileMap:Dictionary = new Dictionary();
var choiceMap:Dictionary = new Dictionary();
var fileMapRef:Object = new Object();
var choiceMapRef:Object = new Object();
var choiceName:String = "";
var choiceVsFile:Array = new Array();

```

```auto

function drawStart(evt:MouseEvent):void
{
 fileMapRef = evt.currentTarget.parent;
 choiceMapRef = evt.currentTarget;
 choiceName = evt.currentTarget.label;
}

```

```auto

function drawFinish(evt:MouseEvent):void
{
 choiceVsFile = [choiceName,evt.currentTarget.parent.name];
 choiceMap[choiceMapRef] = choiceVsFile;
 fileMap[fileMapRef] = choiceMap;
 
[COLOR=darkred] for (var prop:* in fileMap[fileMapRef]) 
 {
  forCounter++;
  trace(fileMap[fileMapRef]choiceMap);
 }[/COLOR]
 trace(forCounter);
 forCounter = 0;
}

```
