# Adding properties to an object - specifically Arrays

**URL:** https://forum.kirupa.com/t/adding-properties-to-an-object-specifically-arrays/316585
**Category:** flash
**Created:** [November 27, 2010, 12:27am UTC](https://forum.kirupa.com/t/adding-properties-to-an-object-specifically-arrays/316585 "2010-11-27T00:27:38Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![zingzangzung](https://avatars.discourse-cdn.com/v4/letter/z/e9c0ed/32.png) [@zingzangzung](https://forum.kirupa.com/u/zingzangzung)
#### Post date: [November 27, 2010, 12:27am UTC](https://forum.kirupa.com/t/adding-properties-to-an-object-specifically-arrays/316585/1 "2010-11-27T00:27:38Z")

</div>

Hi I’m fairly new to AS3. In AS2 I often used objects to store properties so I can creatre them dynamically and refer to them later.

Sometime I use an array as a property. I am wondering if my method of doing this is the best way, or if AS3 has other methods that might be better suited.

In this case I have an object that stores properties like ID no. and I also want to store an array of sub properties which are in array. I am coding like this -

```php
var o:Object = new Object();
dataStorageArray = new Array();

//fill data storage array then add as propert of object

o.dataStorage = dataStorageArray;

//then later get data by - 

requiredData = o.dataStorage[6]; //for example

```

Just wondering if there is a better way of doing this kind of thing in AS3
