设为首页 加入收藏 网站搜索 繁體中文 中国建站网 — 站长资源分享平台

FLASH移动放大的图片效果

来源:136z.Com 作者:佚名 时间:2005-12-30 11:39:50


代码和他有所不同。和其他人的如有雷同,纯属巧合。

教程:
其他部分就不讲了,看看源文件就知道了。主要说说AS部分。

拖动块上代码:


on (press) {
ymin=_root.tp_mc.tp_mc1._width-_root.tp_mc.drag._width;
xmin=_root.tp_mc.tp_mc1._height-_root.tp_mc.drag._height;
startDrag("_root.tp_mc.drag",false,0,0,ymin,xmin)//拖动按钮,拖动范围设置。
trace(ymin);
trace(xmin);
}
on (release) {
stopDrag();
}//停止拖动
桢上代码:
this.drag._x=0;
this.drag._y=0;//定义拖动块的初始位置;
this.drag1._x=-150;
this.drag1._y=30;//定义遮罩块的初始位置;
this.tp_mc2._x=-150;
this.tp_mc2._y=30;//定义被遮图片的初始位置;
this.drag1._xscale=170;
this.drag1._yscale=170;//遮罩块放大
this.tp_mc2._xscale=170;
this.tp_mc2._yscale=170;//将被遮罩图片放大;
speed=0.5;
xtpmc=_root.tp_mc.tp_mc2._x;
ytpmc=_root.tp_mc.tp_mc2._y;//被遮图片初始位置;
bs=this.tp_mc2._width/this.tp_mc1._width;//大小图片之间倍数;
_root.tp_mc.tp_mc2.setMask(_root.tp_mc.drag1);//遮罩tp_mc2
trace("tp:"+bs);
_root.onEnterFrame=function(){
_root.tp_mc.tp_mc2._x+=((xtpmc+_root.tp_mc.drag._x*-bs)-_root.tp_mc.tp_mc2._x)*speed;
_root.tp_mc.tp_mc2._y+=((ytpmc+_root.tp_mc.drag._y*-bs)-_root.tp_mc.tp_mc2._y)*speed;//缓移;
trace(_root.tp_mc.drag._x*bs)
}

点击下载该文件

【责任编辑 李旭海】

Tags:

  • 好的评价 如果您觉得好,就请您
      0%(0)
  • 差的评价 如果您觉得差,就请您
      0%(0)
  • 相关文章
    广告赞助

    文章随便看看 设计素材 建站学院 网页模板 视频教程

    网友评论

    共有 0 位网友发表了评论,得分 0 分,平均 0 分    查看完整评论

    用户名: 查看更多评论

    分 值:100分 85分 70分 55分 40分 25分 10分 1分

    内 容:

             通知管理员 验证码: