Actionscript学习实例:简单放大镜效果
类别: Flash教程
效果如下:
代码(全部写在帧上):
fscommand("allowscale","false")
_root.picture.setMask(_root.big_glass.pian);
_root.shuru.onChanged = function() {
_root.picture._xscale = n*100;
_root.picture._yscale = n*100;
}
_root.big_glass.onPress = function() {
this.startDrag();
drag = true;
}
_root.big_glass.onRelease = function() {
stopDrag();
drag = false;
}
_root.big_glass.onEnterFrame = function () {
if(drag = true){
_root.picture._x = -_root.big_glass._x*(_root.n-1);
_root.picture._y = -_root.big_glass._y*(_root.n-1);
}
}
_root.big_glass.onMouseMove = function () {
updateAfterEvent();
}
_root.picture.setMask(_root.big_glass.pian);
_root.shuru.onChanged = function() {
_root.picture._xscale = n*100;
_root.picture._yscale = n*100;
}
_root.big_glass.onPress = function() {
this.startDrag();
drag = true;
}
_root.big_glass.onRelease = function() {
stopDrag();
drag = false;
}
_root.big_glass.onEnterFrame = function () {
if(drag = true){
_root.picture._x = -_root.big_glass._x*(_root.n-1);
_root.picture._y = -_root.big_glass._y*(_root.n-1);
}
}
_root.big_glass.onMouseMove = function () {
updateAfterEvent();
}
- 上一篇: Flash脚本编程--DNA双螺旋结构
- 下一篇: Flash AS制作上升的水泡效果动画
-= 资 源 教 程 =-
文 章 搜 索