效果相不错的鼠标感应代码,相当实用,请大家仔细分析别人代码的应用。
效果预览:
| /* 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; } } |