当前位置: 首页 > 图文教程 > Flash动画 > Flash动画制作 > 图片放大缩小移动类

Flash动画制作
Flash5键盘鼠标应用(二)
Freehand和Flash的结合应用(4)
Flash5 有声音的三眼狼(二)
Freehand和Flash的结合应用(7)
Freehand和Flash的结合应用(10)
Freehand和Flash的结合应用(12)
Flash5 位移操作(二)
Flash5制作水波倒影效果(二)
Flash5任意两点间随机画线(三)
Flash 神奇遮罩之原理篇(3)
Flash 神奇遮罩之动态篇
Flash 神奇遮罩之图片篇(1)
Flash MX 视频导入功能详解(5)
利用Flash MX模板制作XML动态菜单(1)
用动作脚本动态创建和控制文本框 (6)
FW MX和Flash MX的亲密合作(2)
FW MX和Flash MX的亲密合作(5)
Flash中音量和左右声道平衡的控制(2)
Flash MX的AS绘图和时间控制 下
Flash5 有声音的三眼狼(四)

Flash动画制作 中的 图片放大缩小移动类


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-22   浏览: 80 ::
收藏到网摘: n/a

-图片放大缩小移动类:
-----------------------class-------------------------

class ZoomOpenMove {
   private var obj:MovieClip;
   private var pos_scale:Number;
   private var x_speed:Number;
   private var y_speed:Number;
   private var scale_speed:Number;
   private var scale_step:Number;
   public function ZoomOpenMove(_obj:MovieClip) {
      this.obj = _obj;
   }
   public function get s_speed():Number {
      return scale_speed;
   }
   public function set s_speed(_s_speed:Number):Void {
      scale_speed = _s_speed;
   }
   public function get _x_speed():Number {
      return x_speed;
   }
   public function set _x_speed(_x_x_speed:Number):Void {
      x_speed = _x_x_speed;
   }
   public function get _y_speed():Number {
      return y_speed;
   }
   public function set _y_speed(_y_y_speed:Number):Void {
      y_speed = _y_y_speed;
   }
   public function get _scale_step():Number {
      return scale_step;
   }
   public function set _scale_step(scalestep:Number):Void {
      scale_step = scalestep;
   }
   public function get _scale_speed():Number {
      return scale_speed
   }
   public function set _scale_speed(scalespeed:Number):Void {
      scale_speed = scalespeed
   }
   public function get _pos_scale():Number {
      return pos_scale;
   }
   public function set _pos_scale(posscale:Number):Void {
      pos_scale = posscale;
   }
   public function Open() {
      if (_root._xmouse<Stage.width and _root._xmouse>0 and _root._ymouse>0 and _root._ymouse<Stage.height) {
         obj._xscale<pos_scale ? obj._xscale=obj._yscale += scale_step : obj._xscale=obj._yscale=pos_scale;
      }
   }
   public function Zoom() {
      if (_root._xmouse<Stage.width and _root._xmouse>0 and _root._ymouse>0 and _root._ymouse<Stage.height) {
         obj._x += (0-obj._x)/scale_speed;
         obj._y += (0-obj._y)/scale_speed;
         obj._xscale += (100-obj._xscale)/scale_speed;
         obj._yscale += (100-obj._yscale)/scale_speed;
      }
   }
   public function Move() {
      if (obj.hitTest(_root._xmouse, _root._ymouse, true)) {
         var pos_x = _root._xmouse*(Stage.width-obj._width)/Stage.width;
         var pos_y = _root._ymouse*(Stage.height-obj._height)/Stage.height;
         obj._x += (pos_x-obj._x)/x_speed;
         obj._y += (pos_y-obj._y)/y_spee