as3.0代码,在一个鼠标点击侦听器中要引用一个鼠标移动的侦听器,下面的代码哪里有问题啊?
movieClip_1.addEventListener(MouseEvent.MOVE,changeqizi);movieClip_1.addEventListener...
movieClip_1.addEventListener(MouseEvent.MOVE,changeqizi);
movieClip_1.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
function fl_MouseClickHandler(event:MouseEvent):void
{
......................
movieClip_1.dispatchEvent(MouseEvent.MOVE);
}
function changeqizi(e:MouseEvent):void
{
.....................
}意思就是当鼠标点击侦听器里的代码执行完后就马上执行鼠标移动侦听器里的代码,上面哪里有问题?请高手指教! 展开
movieClip_1.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
function fl_MouseClickHandler(event:MouseEvent):void
{
......................
movieClip_1.dispatchEvent(MouseEvent.MOVE);
}
function changeqizi(e:MouseEvent):void
{
.....................
}意思就是当鼠标点击侦听器里的代码执行完后就马上执行鼠标移动侦听器里的代码,上面哪里有问题?请高手指教! 展开
展开全部
//movieClip_1.addEventListener(MouseEvent.MOVE,changeqizi);
movieClip_1.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
function fl_MouseClickHandler(event:MouseEvent):void
{
......................
//movieClip_1.dispatchEvent(MouseEvent.MOVE);
movieClip_1.addEventListener(MouseEvent.MOVE,changeqizi);
}
function changeqizi(e:MouseEvent):void
{
.....................
}
直接这样不就ok了·····
movieClip_1.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
function fl_MouseClickHandler(event:MouseEvent):void
{
......................
//movieClip_1.dispatchEvent(MouseEvent.MOVE);
movieClip_1.addEventListener(MouseEvent.MOVE,changeqizi);
}
function changeqizi(e:MouseEvent):void
{
.....................
}
直接这样不就ok了·····
追问
我的天,这也行啊?
追答
大哥为啥不行呢
对了 上面移动的侦听应该是这样
mc.addEventListener(MouseEvent.MOUSE_MOVE,changeqizi);
MOUSE_MOVE不是MOVE
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询