0

首先,请看我的 SWF: http: //krakow45.pl/spec/warcaby/Warcaby3D.html

您可以移动棋子,并且效果很好。但是当你翻译游戏板时问题就开始了(通过按任何方向键)。在此之后你不能移动棋子。这是我的一小段代码:

翻译:

case Keyboard.LEFT:
    _matrix = new Matrix3D();

_matrix.appendTranslation(0, -200, 0);
_matrix.appendRotation(_rot++, Vector3D.X_AXIS);
_matrix.appendTranslation(0, 200, _depth);

_table._board.transform.matrix3D = _matrix;

break;

移动棋子:

private function MouseDown(event:MouseEvent):void
    {
        var pawn:Pawn = event.currentTarget as Pawn;

        _xPos = pawn._xPos;
        _yPos = pawn._yPos;

        _txt.text = pawn._xPos + " - " + pawn._yPos + "\n";

        pawn.startDrag();
    }
4

1 回答 1

0

好的,我通过使用这样的方法解决了这个问题:(针对 startStag() )

private var _clicked:Boolean
private var _currentPawn:Pawn

private function MouseDown(event:MouseEvent):void
{
    _clicked = true;
    _currentPawn = event.currentTarget as Pawn;
    // rest of my code
}

private function MouseMove(event:MouseEvent):void
{
    if(_clicked)
    {
        _currentPawn.x = mouseX;
        _currentPawn.y = mouseY;
    }
}

private function MouseUp(event:MouseEvent):void
{
    _clicked = false;
// rest of my code
}
于 2013-05-04T14:00:44.493 回答