as3.0 怎样实现按下某一按钮后,鼠标指针样式切换为自定义的样式?
1个回答
展开全部
import flash.display.Shape;
import flash.events.MouseEvent;
//我们让鼠标切换成一个圆形
//在这里我不用按钮了,直接点击舞台就可以了
function drawCir():Shape
{
var s:Shape=new Shape();
with (s.graphics)
{
beginFill(0x0055aa,1);
drawCircle(0,0,8);
endFill();
}
return s;
}
var mouseS:Shape = drawCir();
stage.addEventListener(MouseEvent.MOUSE_DOWN,onDow);
function onDow(evt:MouseEvent):void
{
Mouse.hide();
mouseS.x=mouseX;
mouseS.y=mouseY;
addChild(mouseS);
evt.currentTarget.addEventListener(MouseEvent.MOUSE_MOVE,onMove);
}
function onMove(evt:MouseEvent):void
{
mouseS.x=mouseX;
mouseS.y=mouseY;
}
import flash.events.MouseEvent;
//我们让鼠标切换成一个圆形
//在这里我不用按钮了,直接点击舞台就可以了
function drawCir():Shape
{
var s:Shape=new Shape();
with (s.graphics)
{
beginFill(0x0055aa,1);
drawCircle(0,0,8);
endFill();
}
return s;
}
var mouseS:Shape = drawCir();
stage.addEventListener(MouseEvent.MOUSE_DOWN,onDow);
function onDow(evt:MouseEvent):void
{
Mouse.hide();
mouseS.x=mouseX;
mouseS.y=mouseY;
addChild(mouseS);
evt.currentTarget.addEventListener(MouseEvent.MOUSE_MOVE,onMove);
}
function onMove(evt:MouseEvent):void
{
mouseS.x=mouseX;
mouseS.y=mouseY;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询