本页面由 Flash 保存计划 从 Internet Archive 存档还原 · 快照 2005-12-26 · 原址 http://flash8.net/teach/4564.htm ← Flash 保存计划

picturescroll鼠标滚动图片

作者:egoldy   类型:转载   来源:webstudio

  使用鼠标移动感应移动图片,做网站的朋友兴许可以用的上.以前做过N多个,兴许这么做简单一些.
picture_scroll.rar

在第一帧上加入如下代码.picture为图片剪辑,dragControl为一个空的影片剪辑参照.
/*
copyright by webstudio.com.cn.author by egoldy.2005-10-30
*/
stop();
//影片宽高
var widthx=400;
var heighx=300;
//循环
onEnterFrame=function(){
//拖动参照移动,只要是利用它的坐标
onMouseMove=function(){
startDrag("dragControl", true);
}
trace(_root.dragControl._x);
// 图片移动
_root.picture._x+=(dragControl._x*(-1)-picture._x)*0.2;
// 结束位置条件
if (dragControl._x>=widthx) {
 _root.picture._x=-picture._width;
 
}
//开始位置条件
if (dragControl._x<=-1) {
 _root.picture._x=-1;
}
}
   责任编辑:uufeng    时间:2005年10月31日

正在加载评论...