# Passing array through flashvars

**URL:** <https://forum.kirupa.com/t/passing-array-through-flashvars/276551>\
**Category:** Uncategorized\
**Created:** [November 30, 2008, 8:05pm UTC](https://forum.kirupa.com/t/passing-array-through-flashvars/276551 "2008-11-30T20:05:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Didi32](https://avatars.discourse-cdn.com/v4/letter/d/eb8c5e/32.png) [@Didi32](https://forum.kirupa.com/u/Didi32)\
**Post date:** [November 30, 2008, 8:05pm UTC](https://forum.kirupa.com/t/passing-array-through-flashvars/276551/1 "2008-11-30T20:05:08Z")

</div>

Hi,

I’m using a php script (this question really is about AS3) to output the following code:  
card0: ‘7’, card1: ‘19’, card2: ‘17’, card3: ‘21’, card4: ‘18’  
and pass these values into my flash. What I would like to get in the end however is an array with all these values – without knowing how many there are (could be card5, card6 …).  
My question is whether it’s possible easily or if passing the following would be better:  
cards: ‘7,19,17,21,18’,  
Is there an automatic way to create an array from these values (which really is a string in fact) into broken values into an array something like this:

```auto
var flCards:Array = new Array(paramObj['cards']);
output:
flCards[0] = 7;
flCards[1] = 19;
etc...

```

I’ve been struggling with the first flashvars trying to figure out how many cardX there really are and I don’t know how to make a string of numbers delimited with commas into an array.  
Shall I do a string replace, something similar, or is there an easier way?

Thanks for your help,
