Hi everyone! I’m trying to assign values to my array. Here is what I have so far.
_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”.
if ("circle" ){
storedvalue="yellow circle"
]
else if ("square"){
storedvalue="blue square"
}
else if ("triangle") {
storedvalue="green triangle"
}
Hope this makes sense???