away3Dについて少し質問があります。同じ場所に配置された、まったく同じ寸法の立方体がいくつかあります。キューブのスタックをクリックしたときに、最後に追加したキューブのクリックを登録したいと思います。これを行う代わりに、クリックは最初に追加したキューブに登録されます。
コンテナ内の立方体の位置を変更する方法を見つけ、その要素をchildrenArrayの最後(以下のコード)と最初に配置しようとしましたが、何も機能しないようです。私は本当にここで立ち往生しているので、スタックをクリックしたときにトップレベルの要素を取得する方法を誰かが知っているなら、私は聞いてうれしいです。
//We get the targetCube's childIndex.
for(var i:uint = 0; i < _3DContent.children.length; i++)
{
if(_targetCube == _3DContent.children[i])
break;
}
//Now we rearrange the array if the targetCube is different from
//the last cube in our list of children.
if(i != _3DContent.children.length-1)
{
//We reposition the children.
for(var j:uint = i; j < _3DContent.children.length-1; j++)
_3DContent.children[j] = _3DContent.children[j+1];
//Lastly, we push the child.
_3DContent.children[_3DContent.children.length-1] = _targetCube;
}