.flash bbox=550x450 version=9 name="dragtest3.swf" compress .edittext log width=400 height=50 readonly .put log 0 0 .box bx 190 190 color=blue line=1 # //150+(2*20) .put bx 0 0 .circle cercle r=20 color=red fill=white .sprite dragspr .put cercle .end .put sp1=dragspr 5 5 .put sp2=dragspr 70 70 red=0 .put sp3=dragspr 130 130 blue=0 .action: package { import flash.display.*; import flash.text.* ; import flash.events.* ; import flash.geom.Rectangle ; public dynamic class Main extends MovieClip { var rect : Rectangle ; function trace (s) { this.log.text=s+"\n"; } function m_down(evt) { evt.target.startDrag(false); } function p_down(evt) { this.sp2.startDrag(false,rect); } function m_rel(evt) { trace(evt.target.name); evt.target.stopDrag(); } public function Main() { trace ("Drag test (cyan circle is limited ) "); rect=new Rectangle(); rect.width=rect.height=150; this.sp1.addEventListener(MouseEvent.MOUSE_DOWN,m_down); this.sp1.addEventListener(MouseEvent.MOUSE_UP ,m_rel); this.sp2.addEventListener(MouseEvent.MOUSE_DOWN,p_down); this.sp2.addEventListener(MouseEvent.MOUSE_UP ,m_rel); this.sp3.addEventListener(MouseEvent.MOUSE_DOWN,m_down); this.sp3.addEventListener(MouseEvent.MOUSE_UP ,m_rel); } } } .end #action .end # End .flash