ball.as
来自「只FLASH源文件」· AS 代码 · 共 23 行
AS
23 行
package {
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class Ball extends MovieClip {
public function Ball() {
trace("ball created: " + this.name);
this.buttonMode = true;
this.addEventListener(MouseEvent.CLICK, clickHandler);
this.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownListener);
this.addEventListener(MouseEvent.MOUSE_UP, mouseUpListener);
}
private function clickHandler(event:MouseEvent):void {
trace("You clicked the ball");
}
function mouseDownListener(event:MouseEvent):void {
this.startDrag();
}
function mouseUpListener(event:MouseEvent):void {
this.stopDrag();
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?