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

Flash动画制作
我是大导演 MTV创作速成教程
二合一按钮的制作
[DIY]这种相册你有吗?
教你一招绝的!把Flash动画转换成VCD视频
使用Flash MX的3个小技巧
Flash课件一网打尽
Flash Player 7 安全策略解析
FlashMX特效之扩散与挤压
Flash MX 2004 体验之旅
Flash使用技巧--用Flash制作拖拉式菜单
Flash使用技巧--用Flash制作转动的地球仪
Flash使用技巧--用Flash 5制作Winamp光谱柱的效果
Flash使用技巧--用Flash制作落地有声的瓶子
Flash使用技巧--用Flash 5巧做“弹出”效果菜单
Flash使用技巧--用Flash制作即指即现的广告条
用大师级软件MixFX轻松打造专业FLASH
用Flash MX快速制作沟通留言程序
用Flash制作动感效果的网页链接提示框
巧妙运用Flash MX 2004制作“拖曳配对题”
用Flash MX制作精彩的粉荷清波动画特效一例

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-22   浏览: 27 ::
收藏到网摘: 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