LOFTER for ipad —— 让兴趣,更有趣

点击下载 关闭

greensock

174浏览    1参与
flash163

BlitMask

BlitMask(
target:DisplayObject, //遮罩的目标影片
x:Number = 0, //遮罩层x坐标
y:Number = 0, //遮罩层y坐标
width:Number = 100, //遮罩层宽度
height:Number = 100, //遮罩层高度
smoothing:Boolean = false, //遮罩滑动动画
autoUpdate:Boolean = false,//遮罩更新
fillColor:uint = 0x00000000, //遮罩层填色
wrap:Boolean = false)//遮罩是否循环

example1:

TweenLite.to(mc...

BlitMask(
target:DisplayObject, //遮罩的目标影片
x:Number = 0, //遮罩层x坐标
y:Number = 0, //遮罩层y坐标
width:Number = 100, //遮罩层宽度
height:Number = 100, //遮罩层高度
smoothing:Boolean = false, //遮罩滑动动画
autoUpdate:Boolean = false,//遮罩更新
fillColor:uint = 0x00000000, //遮罩层填色
wrap:Boolean = false)//遮罩是否循环

example1:

TweenLite.to(mc, 3, {x:400, onStart:myBlitMask.enableBitmapMode, onUpdate:myBlitMask.update, onComplete:myBlitMask.disableBitmapMode

example2:

myBlitMask.scrollX = 0;
TweenLite.to(myBlitMask, 5, {scrollX:1});

example3:

//create a 200x200 BlitMask positioned at x:20, y:50 to mask our "mc" object and turn smoothing on:
var blitMask:BlitMask = new BlitMask(mc, 20, 50, 200, 200, true);

//position mc at the top left of the BlitMask using the scrollX and scrollY properties
blitMask.scrollX = 0;
blitMask.scrollY = 0;

//tween the scrollY to make mc scroll to the bottom over the course of 3 seconds and then turn off bitmapMode so that mc becomes interactive:
TweenLite.to(blitMask, 3, {scrollY:1, onComplete:blitMask.disableBitmapMode});

//or simply position mc manually and then call update() to sync the display:
mc.x = 350;
blitMask.update();

example4:
var bm:BlitMask = new BlitMask(mc, 0, 0, 300, 200, true);
TweenLite.to(mc, 3, {x:200, onUpdate:bm.update, onComplete:completeHandler});
function completeHandler():void { bm.bitmapMode = false; }

BlitMask.addEventListener(MouseEvent.ROLL_OUT,myevent)
BlitMask.normalizePosition()
BlitMask.bitmapMode=true

LOFTER

让兴趣,更有趣

简单随性的记录
丰富多彩的内容
让生活更加充实

下载移动端
关注最新消息