# Setting an array as part of a custom class

**URL:** https://forum.kirupa.com/t/setting-an-array-as-part-of-a-custom-class/199326
**Category:** flash
**Created:** [September 1, 2006, 2:05pm UTC](https://forum.kirupa.com/t/setting-an-array-as-part-of-a-custom-class/199326 "2006-09-01T14:05:27Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![schmichael](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@schmichael](https://forum.kirupa.com/u/schmichael)
#### Post date: [September 1, 2006, 2:05pm UTC](https://forum.kirupa.com/t/setting-an-array-as-part-of-a-custom-class/199326/1 "2006-09-01T14:05:27Z")

</div>

Hello there, i am trying to make a custom class that has a small number of variables but I can’t seem to get the array part to work. The class file looks like this:  
ActionScript Code:  
[FONT=Courier New][LEFT][COLOR=#000000] **class** [/COLOR] Row [COLOR=#000000]{[/COLOR]  
[COLOR=#0000ff]public[/COLOR] [COLOR=#000000] **var** [/COLOR] cards:[COLOR=#0000ff]Array[/COLOR];  
[COLOR=#0000ff]public[/COLOR] [COLOR=#000000] **var** [/COLOR] toGo:[COLOR=#0000ff]Number[/COLOR] = [COLOR=#000080]5[/COLOR];  
[COLOR=#0000ff]public[/COLOR] [COLOR=#000000] **var** [/COLOR] gameState:[COLOR=#0000ff]Number[/COLOR] = [COLOR=#000080]0[/COLOR];  
[COLOR=#000000]}[/COLOR]  
[/LEFT]  
[/FONT]

When I try and set the values of the array like this:  
ActionScript Code:  
[FONT=Courier New][LEFT]row1.[COLOR=#000080]cards[/COLOR][COLOR=#000000][[/COLOR][COLOR=#000080]0[/COLOR][COLOR=#000000]][/COLOR] = [COLOR=#ff0000]“as”[/COLOR]  
[/LEFT]  
[/FONT]

or this:  
ActionScript Code:  
[FONT=Courier New][LEFT]row1.[COLOR=#000080]cards[/COLOR] = cards.[COLOR=#0000ff]split[/COLOR]COLOR=#000000[/COLOR]  
[/LEFT]  
[/FONT]

I can’t seem to get it to work. I can set and access the other variables OK its just the array thats giving me problems.

Thanks for any kind help in advance!  
Schm
