I am creating an app with Papervision, and I’m trying to create an interactive grid.
I have created a for loop to lay out each tile of the grid, but I want each tile to be individually interactive. I have tried a few things but no luck so far. This is basically how far I am:
for (var i:uint = 0; i < 10; i++) {
for (var j:uint = 0; j < 10; j++) {
var plane:Plane = new Plane(myMat1, 100, 100);
plane.x = j * 100;
plane.y = i * 100;
this.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS, onPress);
default_scene.addChild(plane);
}
}
it creates the grid but the event listener doesnt work.
I have tried things like “plane[“plane” +i +j].addEventListener” but no luck.
Does anyone have any ideas? Im pretty new to AS3 so keep it simple.:ne: