Randomly generating from an array?

hey just wondered if i could get a bit of help/pointers:

basically i have a list of 17 movie clips that i need to be randomly selected and placed on the stage for a pinball esq game, i already have the gravity code that will effect these movie clips but im at a bit of a loss how to A) randomly select them B) get them to appear on the stage.

help please?

first you sould put them in an array. if you named them like (thein1, thing2 thing3) you don’t need to do this but an array is more flexazbile

theng_array = [name1, thing, bit, bob]

then you’ll need a for loop to place them


for (var i:Number = 0; i<theng_array.length; i++) {
tempName = theng_array*
tempName._x = random(Stage.width-20)+10
tempName._y = random(Stage.height-20)+10
}

i used random(Stage.width-20)+10 to find a place on Stage that is 10 away from all sides