var shapes:Array = new Array("square", "circle", "rectangle");
var letters:Array =new Array("alpha", "beta", "gama");
var names:Array =new Array("Barney", "Sponge Bobb", "Dora");
var myAlpha:Array=[];
var one:Number;
var two:Number;
var three:Number;
function selectalpha(){
var minNum:Number = 0;
//Gets the lenght of an array and returns a value
var maxNum:Number = shapes.length;
one = Math.ceil(Math.random()*(maxNum-minNum+1))+(minNum-1);
//pushes the value into an array
myAlpha.push(one);
minNum = 0;
maxNum = letters.length;
two = Math.ceil(Math.random()*(maxNum-minNum+1))+(minNum-1);
myAlpha.push(two);
minNum = 0;
maxNum = names.length;
three = Math.ceil(Math.random()*(maxNum-minNum+1))+(minNum-1);
myAlpha.push(three);
pulltogether(myAlpha);
}
trace(three);
//calls the function that will place the shapes on the stage
function pulltogether(test:Array) {
_root.createEmptyMovieClip("Placement", 2);
Placement.attachMovie(shapes[0],Placement.getNextHighestDepth(), {_x:0, _y:0});
Placement.attachMovie(letters[0],Placement.getNextHighestDepth+1(), {_x:0, _y:0});
Placement.attachMovie(names[0],Placement.getNextHighestDepth+2(), {_x:0, _y:0});
Placement._x = 190;
Placement._y = 50;
}
I traced my depths and I got
shapes depth=1
letters depth=1
names depth =1
For some reason if all my depths are 1 only 1 of the movie clips will display
if depth are different
shapes depth=0
letters depth=2
names depth =3
They will display correctly.???

New Topic/Question
Reply



MultiQuote





|