首先创建画布喽 大小随意 针速设成60 然后随便拖张图片当背景。然后我们找一个可以用来当鼠标指针的小图片把图片转换成影片剪辑命名为“指针"。新建一个层把“指针"拖到场景中
接下来就开始写脚本楼
在指针剪辑 的属性栏里 把它命名为mc_mouse,然后在影片剪辑上加入脚本
onClipEvent (load)
{
xPos = 0;
yPos = 0;设置x,y坐标的初始位置
}
onClipEvent (enterFrame)
{
elastic = 0.400000;//设置弹性系数
friction = 0.700000;//设置摩擦力系数
xfriction = (xPos - _x) * elastic + xfriction * friction;
yfriction = (yPos - _y) * elastic + yfriction * friction;//设置当鼠标移动后的位置改变量
this._x = this._x + xfriction;
this._y = this._y + yfriction;//设置鼠标现在的位置
}
{
xPos = 0;
yPos = 0;设置x,y坐标的初始位置
}
onClipEvent (enterFrame)
{
elastic = 0.400000;//设置弹性系数
friction = 0.700000;//设置摩擦力系数
xfriction = (xPos - _x) * elastic + xfriction * friction;
yfriction = (yPos - _y) * elastic + yfriction * friction;//设置当鼠标移动后的位置改变量
this._x = this._x + xfriction;
this._y = this._y + yfriction;//设置鼠标现在的位置
}
然后我们回到主场景 新建一个层作为脚本层,在第一针插入空白关键针 写上脚本
fscommand("fullscreen", "false");//指定 播放器为 常规菜单视图。
fscommand("allowscale", "false");//播放器以始终按 SWF 文件的原始大小绘制 SWF 文件
fscommand("showmenu", "false");
Mouse.hide();//隐藏鼠标
mc_mouse.xPos = _root._xmouse;
mc_mouse.yPos = _root._ymouse;//设置横纵坐标的位置
fscommand("allowscale", "false");//播放器以始终按 SWF 文件的原始大小绘制 SWF 文件
fscommand("showmenu", "false");
Mouse.hide();//隐藏鼠标
mc_mouse.xPos = _root._xmouse;
mc_mouse.yPos = _root._ymouse;//设置横纵坐标的位置
将第2针转换成空白关建针写上
gotoAndPlay(1);
好了完成了!
效果如下:
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
- 上一篇:Flash8 脚本助手试用手记
- 下一篇:没有了
- 最新评论 查看所有评论
-
- 发表评论 查看所有评论
-
- 推荐内容
-
- 用AS2解决中文ID3的乱码
flash如果MP3的ID3标签使用GB2312编码,那么在FLASH脚本输出时是乱码...
- 用AS2解决中文ID3的乱码

