flex学习-----获取鼠标坐标
<mx:Panel mouseMove="getLocation(event:MouseEvent)"><mx:Button label="Button" /></mx:Panel> /** ??????? trace("localX:" + event.localX + ",localY:" + event.localY);? //相对于组件的坐标,(如果在button上,则相对于button) ??????? trace("stageX:" + event.stageX + ",stageY:" + event.stageY);? //相对于整个应用的坐标 ??????? trace("mouseX:" + DisplayObject.mouseX + ",mouseY:DisplayObject.mouseY:" + DisplayObject.mouseY); //相对于 DisplayObject容器或组件的坐标 ??????? trace("contentMouseX:" + Container.contentMouseX + ",contentMouseY:" + Container.contentMouseY);? //相对于容易的坐标 ???? } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |