第二章 ActionScript 3.0 动画基础Ⅱ[FL 基理译]
2009-05-30 12:08:54 来源:WEB开发网package {
import flash.display.Sprite;
import flash.events.MouseEvent;
public class MouseEvents extends Sprite {
public function MouseEvents() {
init();
}
private function init():void {
var sprite:Sprite = new Sprite();
addChild(sprite);
sprite.graphics.beginFill(0xff0000);
sprite.graphics.drawCircle(0, 0, 50);
sprite.graphics.endFill();
sprite.x = stage.stageWidth / 2;
sprite.y = stage.stageHeight / 2;
sprite.addEventListener(MouseEvent.CLICK, onMouseEvent);
sprite.addEventListener(MouseEvent.DOUBLE_CLICK,onMouseEvent);
sprite.addEventListener(MouseEvent.MOUSE_DOWN,onMouseEvent);
sprite.addEventListener(MouseEvent.MOUSE_MOVE,onMouseEvent);
sprite.addEventListener(MouseEvent.MOUSE_OUT,onMouseEvent);
sprite.addEventListener(MouseEvent.MOUSE_OVER,onMouseEvent);
sprite.addEventListener(MouseEvent.MOUSE_UP,onMouseEvent);
sprite.addEventListener(MouseEvent.MOUSE_WHEEL,onMouseEvent);
sprite.addEventListener(MouseEvent.ROLL_OUT,onMouseEvent);
sprite.addEventListener(MouseEvent.ROLL_OVER,onMouseEvent);
}
public function onMouseEvent(event:MouseEvent):void {
trace(event.type);
}
}
}
Tags:第二章 ActionScript 动画
编辑录入:爽爽 [复制链接] [打 印]- ››ActionScript 2.0中的! 逻辑 NOT 运算符
- ››动画制作之&按位AND 运算符
- ››动画* 、*= 乘法赋值运算符
- ››ActionScript 3.0 性能方面优化小知识整理收集
- ››动画的前制与制程
- ››第二章 ActionScript 3.0 动画基础Ⅰ[FL 基理译]
- ››第二章 ActionScript 3.0 动画基础Ⅱ[FL 基理译]
- ››ActionScript中文本字段的透明度缓动
- ››ActionScript 3.0 Step By Step系列(一):工欲其善...
- ››ActionScript 3.0 Step By Step系列(二):建立扎实...
- ››ActionScript 3.0 Step By Step系列(三):学学流程...
- ››ActionScript 3.0 Step By Step系列(四):来自面向...
更多精彩
赞助商链接