yo ben, this my code:
var floorGab = Collada.load("floorGab.dae",{autoLoadTextures :
true,scaling:0.005});
floorGab.addOnSuccess(gabLoadSucess)
function gabLoadSucess(evt:LoaderEvent):void{
floorGab = ObjectContainer3D(evt.loader.handle);
floorGab.position = new Number3D(0,0,0);
for(var i:int=0;i <= nbFloor;i++){
floorGab.clone(this["floor"+i])
this["floor" + i].name = "floor" + i
this["floor" + i].y = 20*i
hospital.addChild(this["floor" + i])
this["floor" + i].addOnMouseOver(showFloorInfo);
this["floor" + i].addOnMouseOut(hideFloorInfo);
this["floor" + i].addOnMouseUp(getTheFloor);
this["floor" + i].ownCanvas=true
}
floorMat = floorGab.materialLibrary.getMaterial("floorID")
floorMat.material = gabFloorMat;
}
function showFloorInfo(evt:MouseEvent3D):void{
var currentFloor = evt.object as Mesh
currentFloor.mouseEnabled = true
currentFloor.useHandCursor = true
for(var j:int=0;j<currentFloor.faces.length-1;j++) {
var fd:Face = currentFloor.faces[j] as Face;
fd.material = selectedFloorMat;
}
}
thanks
On 21 juil, 15:43, ben <[email protected]> wrote:
> 1. ok, my fault, the habit of simple MouseEvent, yes this e.object:
> MouseEvent.target == MouseEvent3D.object
>
> 2.... well ? show me how you did the whole cloning and colorchange...