# Using arrays as keys in a dictionary

**URL:** <https://forum.kirupa.com/t/using-arrays-as-keys-in-a-dictionary/276221>\
**Category:** flash\
**Created:** [November 24, 2008, 4:34pm UTC](https://forum.kirupa.com/t/using-arrays-as-keys-in-a-dictionary/276221 "2008-11-24T16:34:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bdol](https://avatars.discourse-cdn.com/v4/letter/b/edb3f5/32.png) [@bdol](https://forum.kirupa.com/u/bdol)\
**Post date:** [November 24, 2008, 4:34pm UTC](https://forum.kirupa.com/t/using-arrays-as-keys-in-a-dictionary/276221/1 "2008-11-24T16:34:38Z")

</div>

Hello all,

I am using a static class to store attributes about various entities in my project. They are represented in 3d space by a typical position vector formatted as (x,y,z). I am trying to store values in the dictionary like so:

```auto
var a:Array = [25,25,25];
var d:Dictionary = new Dictionary();
d[a] = "Hello, world!";

var b:Array = [25,25,25];
trace(d**); // --- error
trace(d[[25,25,25] ]); // --- error

```

Is there a way to accomplish what I’m trying? Can dictionary keys only be object references, or is there is a way to use an array as a key?

Thank you,  
Brian Dolhansky
