AS3 MOUSE_DOWN Sprite不工作

时间:2013-05-08 23:17:30

标签: actionscript-3

对于我的生活,我不记得如何让一个精灵响应MOUSE_DOWN和MOUSE_UP ...如果我将监听器链接到舞台而不是精灵那就有效...我做错了什么?

private function allClassesReady(e:Event):void
{
    userName00 = e.currentTarget.userName0;
    chatArea00 = e.currentTarget.ui0.chatArea0;
    chatInput00 = e.currentTarget.ui0.chatInput0;

    btnArr00 = e.currentTarget.ui0.btnArr0;
    userList00 = e.currentTarget.ui0.userList0;
    msgSo00 = e.currentTarget.shaob0.msgSo0;

    userListSo00 = e.currentTarget.shaob0.userListSo0;

    main00.stage.addEventListener(KeyboardEvent.KEY_DOWN, displayKey);
    main00.stage.addEventListener(MouseEvent.MOUSE_WHEEL, scrollsTxtArea, false, 0, true);
    /*listens for the enter key on the keyboard so we can send message when pressed*/

    btnArr00[0].addEventListener(MouseEvent.MOUSE_DOWN, sendMsg, false, 0, true);
    btnArr00[0].addEventListener(MouseEvent.MOUSE_UP, sendBtnRelease, false, 0, true);
}

0 个答案:

没有答案