Prueba este ejemplo, copia y pega este codigo:
Código :
var mc:MovieClip = this.createEmptyMovieClip("mc",this.getNextHighestDepth());
with(mc){
_x=_y=100;
beginFill(0xEEEEEE,100);
lineStyle(1,0x000000,100);
moveTo(0,0);
lineTo(0, 200);
lineTo(300,200);
lineTo(300,0);
endFill();
}
var mc2:MovieClip = this.createEmptyMovieClip("mc2",this.getNextHighestDepth());
with(mc2){
_x=_y=0;
beginFill(0xCCCCCC,100);
lineStyle(1,0x666666,100);
moveTo(0,0);
lineTo(0, 100);
lineTo(100,100);
lineTo(100,0);
endFill();
}
mc2.createTextField("texto",mc2.getNextHighestDepth(),(mc2._width/4),(mc2._height/4)+16,100,16);
mc2.texto.text="Arrastrame";
mc2.texto.selectable=false;
mc2.onPress = function (){
startDrag(this);
}
mc2.onRelease = function (){
if (((mc.hitTest(mc2._x+mc2._width,mc2._y+mc2._height, true))&&(mc._y<=mc2._y)) &&(mc._x<=mc2._x)){
stopDrag();
}
}quizas te interese es
if (((mc.hitTest(mc2._x+mc2._width,mc2._y+mc2._height, true))&&(mc._y<=mc2._y)) &&(mc._x<=mc2._x)){
stopDrag();
}
saludos