您现在的位置:小学生自学网>> 信息>> 学习电脑

flash拖动到指定区域制作方法

作者: 来源: 发布时间:2015年12月07日 点击数:
 

 

 

把图片做成影片,取名a,做一个b影片,做为指定位置,做成透明的(加载是看不见)
帧上写代码:加载时先记录a的坐标(图片影片剪辑)
  a_x=a._x
  a_y=a._y
  b_x=b._x
  b_y=b._y
a.onPress=function() {
        startDrag(this,true) ;
    }
a.onRelease=function() {
       stopDrag();
      if ( this.hitTest(b)) {
        this._x = b_x
        this._y = b_y
       }else{
       this._x = a_x
       this._y = a_y

   }

flash源代码下载(解压密码fqb)

点击下载