Flash鼠标感应移动图片
作者:我的存在 类型:闪吧BBS 来源:闪吧
实例:
香港全景图片
点击浏览该文件
脚本:
在第一帧上加入如下代码.picture为图片剪辑,dragControl为一个空的影片剪辑参照
香港全景图片
点击浏览该文件脚本:
在第一帧上加入如下代码.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;
}
}
建议观看尺寸:600*400
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年11月6日
- 上一篇:
- 两个swf之间的通讯
- 下一篇:
- flash制作广告全程实例
- 相关教材
- 三分钟搞定全景
- 浅析三维全景
- Photoshop CS轻松合并全景图
- 最近更新
