# Array values

**URL:** <https://forum.kirupa.com/t/array-values/217446>\
**Category:** Uncategorized\
**Created:** [February 27, 2007, 1:08am UTC](https://forum.kirupa.com/t/array-values/217446 "2007-02-27T01:08:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![puthem1st](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@puthem1st](https://forum.kirupa.com/u/puthem1st)\
**Post date:** [February 27, 2007, 1:08am UTC](https://forum.kirupa.com/t/array-values/217446/1 "2007-02-27T01:08:13Z")

</div>

Hi everyone! I’m trying to assign values to my array. Here is what I have so far.

```auto

_root.createEmptyMovieClip("Placement", 2);
var shapes:Array = new Array("square", "circle", "triangle");
function selectshape():String {
    //get the index for the letter
    var index:Number = random(shapes.length);
    //assign the letter to a var
    var s:String = shapes[index];
    //display letter
    return s;
}
trace(selectshape());
//calls the function that will place the shapes on the stage
pulltogether(shapes);
function pulltogether(test:Array) {
    for (var i = 0; i < test.length; i++) {
        Placement.attachMovie(shapes*, shapes*, i+10, {_x:random(200), _y:random(200)});
    }
}

```

What I want to do is say if “circle” is selected than I want to assign a value of “yellow circle”.

```auto
 
     if ("circle" ){
            storedvalue="yellow circle"
   ]
     else if ("square"){
           storedvalue="blue square"
}
     else if ("triangle") {
           storedvalue="green triangle"
}

```

Hope this makes sense???
