Hi,
I got problem with removing hand cursor when i set useHandCursor to false. I
got 9 cubes in 3x3 grid and each has MovieMaterial on face thats facing
camera. I have put addOnMouseDown event and useHandCursor to true when i
created cubes. When one of cubes is clicked I want to remove event(this is
working) and I want to use normal cursor(this is not working). There are
also two buttons on stage. One to remove event and hand cursor and the other
to assign event back with hand cursor. If use off event button event and
hand cursor are removed like I want. I browsed trough mailing list yesterday
evening and i couldnt find simmilar issue.
So, what could be my problem? Clicking on MovieMaterial or something else?
Ill post some code but if you need all please say.
private function initPanels():void
{
startValues_arr = new Array();
for (var i:int = 0; i < nrOfPanels; i++)
{
panel = new Cube( { cubeMaterials:this["panelMaterialsData_"+i],
name:"panel_" + i, height:200, width:200, depth:100 } );
panel.x = -250 +(200 + gridSpace) * a;
panel.y = -250 +(200 + gridSpace) * b;
panel.quarterFaces();
panel.useHandCursor = true;
panel.addOnMouseDown(onPanelDown);
if (a >= 2)
{
a = 0;
b++;
} else
{
a++;
}
startValues_arr.push( { ime:panel.name, startX:panel.x, startY:panel.y,
startZ:panel.z,rotX:panel.rotationX,rotY:panel.rotationY,rotZ:panel.rotationZ
} );
scene.addChild(panel);
}
private function onPanelDown(e:MouseEvent3D):void
{
trace("click: " + e.currentTarget.name);
disablePanelEvents();
}
private function disablePanelEvents():void
{
for (var i:int = 0; i < nrOfPanels; i++)
{
var tempPanel = scene.getChildByName("panel_" + i);
tempPanel.removeOnMouseDown(onPanelDown);
tempPanel.useHandCursor = false; //-----------------------------> this is
not working when clicked on cube, but working when this function is called
from 2d button
}
}