请问下flash中具体怎样实现地图跟随鼠标移动而移动哦,谢谢
2个回答
展开全部
as3.0:
stage.addEventListener(MouseEvent.MOUSE_DOWN,onendown);
private function onendown(event:Event):void{
stage.addEventListener(MouseEvent.MOUSE_UP,onenup);
精灵名称.startDrag();
}
private function onenup(event:Event):void{
stage.removeEventListener(MouseEvent.MOUSE_UP,onenuo);
精灵名称.stopDrag();
}
as2.0:
on (release) {
startDrag("");
}
stage.addEventListener(MouseEvent.MOUSE_DOWN,onendown);
private function onendown(event:Event):void{
stage.addEventListener(MouseEvent.MOUSE_UP,onenup);
精灵名称.startDrag();
}
private function onenup(event:Event):void{
stage.removeEventListener(MouseEvent.MOUSE_UP,onenuo);
精灵名称.stopDrag();
}
as2.0:
on (release) {
startDrag("");
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询