actionscript,鼠标事件不起作用,新手提问,求解
代码如下:packagehf{importflash.display.Sprite;importflash.events.Event;importflash.events...
代码如下:
package hf
{
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
[SWF(width=760, height=535, frameRate=24)]
public class DrawStraightLine extends Sprite
{
public function DrawStraightLine()
{
graphics.lineStyle(1,0,1);
graphics.moveTo(0,0);
// graphics.lineTo(100,100);
addEventListener(MouseEvent.MOUSE_DOWN,onMouseSClick);
}
private function onMouseSClick(mouseEvent:Event):void {
trace('succed');
graphics.lineTo(100,100);
}
}
}
点击鼠标,没有后台日志打印。 展开
package hf
{
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
[SWF(width=760, height=535, frameRate=24)]
public class DrawStraightLine extends Sprite
{
public function DrawStraightLine()
{
graphics.lineStyle(1,0,1);
graphics.moveTo(0,0);
// graphics.lineTo(100,100);
addEventListener(MouseEvent.MOUSE_DOWN,onMouseSClick);
}
private function onMouseSClick(mouseEvent:Event):void {
trace('succed');
graphics.lineTo(100,100);
}
}
}
点击鼠标,没有后台日志打印。 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询