Hi!
I’m developing a game and the objective is to drag some objects to a container. Some objects add points, and some other subtract points.
So, all the objects are in the library and have a linkage name to be called by attachMovie.
I want to create an Array with all the objects that belong to container, like for example filename1 = [“obj1”, “obj2”, “obj3”]; etc…
I have a var called count1 that defines the number of objects to appear on the Scene
So what I have is:
count1 = 5;
function createTest() {
filename1 = [“obj1”, “obj2”];
i = filename1.length;
k = Math.floor(Math.random()i);
for (i=0; i<count1; i++) {
vazio1.attachMovie(filename1, filename1*, i);
}
}
When I test this, only appears two objects because the array as only two objects, but what I want is to show “obj1+i” and “obj2+i” = 5 objects
How can I do this? Show 5 objects radomly, using obj1 and obj2?
Thanks
PS: Sorry about my english
PS2: I think I’ll put this sentence “Sorry about my english” as signature!