Flash

flash Drag & Drop 예

OJR 2008. 10. 30. 10:30

for( var i=1 ; i<5; i++){
 this["m"+i].onPress = function(){
  if( this._alpha != 100 ) return;
  this.startDrag();
  this.x = this._x;
  this.y = this._y;
 }
 this["m"+i].n = i;
 this["m"+i].onRelease = function(){
  for( var j=1;j<5;j++){
   if( this._parent["a"+j].hitTest(this._x, this._y, this) && this.n == j ){
    this._parent["a"+j].gotoAndStop(2);
    this._alpha = 50;
   }
   trace( this._parent["a"+j].hitTest(this._x, this._y, this) );
  }
  this.stopDrag();
  this._x = this.x;
  this._y = this.y;
 }
}

후후

'Flash' 카테고리의 다른 글

flash player 9  (0) 2008.11.07
Flash sound  (0) 2008.11.07
Action Scrambler  (0) 2008.10.21
Flash wmode - openx 에서 플래시 광고 문제  (0) 2008.10.07
flash 한글 keycode 얻기  (0) 2008.07.09