Loading content through arrays

i’m trying to create a level where the objects within the level are loaded dynamically through arrays. I found some code in a tutorial on the web but when i put it in my project nothing happens. I have the “box” in the library and the box is linked (exported for actionscript) as “box” but it still doesn’t work.

Here is my code

function createWorld() {
objects = new Array();
objects.push({type:“box”, x:0, y:0});
objects.push({type:“box”, x:0, y:150});
objects.push({type:“box”, x:0, y:250});
}
function createObjects() {
for (i=0; i<objects.length ;="" i="" {="">
_root.attachMovie(object*.type, "object "+i, i);
}
}
createWorld();
createObjects();</objects.length>