Flash AS教程_-响应鼠标滚动轴的缓动遮罩内容教程
21视频教程网3月28日整理
this.createEmptyMovieClip("mask",this.getNextHighestDepth());
mask.lineStyle(2,0x555555,100);
mask.beginFill(0xcccccc,100);
mask.moveTo(0,0);
mask.lineTo(300,0);
mask.lineTo(300,310);
mask.lineTo(0,310);
mask.lineTo(0,0);
mask._x = 230;
mask._y = 50;
mask.endFill();
spider.setMask(mask);
mouseListener = new Object();
mouseListener.onMouseWheel = function(amount) {
ymove = amount*30.5;
if(_root._xmouse > mask._x && _root._xmouse < mask._x + mask._width && _root._ymouse > mask._y && _root._ymouse < mask._y + mask._height){
dy += ymove;
top = -440;
bottom = 50;
if(dy > bottom)dy = bottom;
if(dy < top)dy = top;
}
}
Mouse.addListener(mouseListener);
spider.onEnterFrame = function(){
speed = 6;
oldy = this._y;
this._y += (dy - oldy)/speed;
}
dy = 0;
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |