最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
拖动及动态遮罩
时间:2022-07-02 17:08:54 编辑:袖梨 来源:一聚教程网
码如下:
import .display.Sprite;
import flash.events.MouseEvent;
import flash.geom.Rectangle
var rect:Rectangle = new Rectangle(80,120, 350, 160);
var circle:Sprite = new Sprite();
circle.graphics.beginFill(0xFFCC00);
circle.graphics.drawCircle(0, 0, 80);
circle.x=200
circle.y=200
addChild(circle);
circle.buttonMode=true
circle.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
function mouseDown(event:MouseEvent):void {
circle.startDrag(true,rect);
}
circle.addEventListener(MouseEvent.MOUSE_UP, mouseReleased);
function mouseReleased(event:MouseEvent):void {
circle.stopDrag();
}
mc.mask=circle
mc为导入的一背景图片转的影片剪辑
相关文章
- 烽烟手游新手怎么玩 新手入门玩法详细攻略 03-25
- 《暗区突围》S17赛季诡雾山谷即将来袭 03-25
- 流行的手机飞机游戏排行榜前十名 免费的飞机游戏盘点2026 03-25
- 《草图大师》调颜色教程 03-25
- 爱探险的朵拉游戏下载推荐 经典的朵拉游戏排行2026 03-25
- 有趣的4x4越野游戏手机版下载 好玩的越野车游戏合集2026 03-25