# Drag problem

**URL:** <https://forum.kirupa.com/t/drag-problem/183842>\
**Category:** Uncategorized\
**Created:** [March 30, 2006, 4:38pm UTC](https://forum.kirupa.com/t/drag-problem/183842 "2006-03-30T16:38:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![g5604](https://avatars.discourse-cdn.com/v4/letter/g/54ee81/32.png) [@g5604](https://forum.kirupa.com/u/g5604)\
**Post date:** [March 30, 2006, 4:38pm UTC](https://forum.kirupa.com/t/drag-problem/183842/1 "2006-03-30T16:38:49Z")

</div>

Hi,

i am trying to attach a movie and then drag it, this works but the code to stop the drag does not. any ideas why??

```php
myButton.onPress = function() {
                            dragger = attachMovie("dragger", "dragger2", 5);
                            dragger._x = this._x 
                            dragger._y = this._y 
                            dragger.startDrag();
                        };
                        myButton.onRelease = function() {
                dragger.stopDrag();
                        };

```

---

<div class="post-metadata">

**Author:** ![B\_L\_U\_E](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@B\_L\_U\_E](https://forum.kirupa.com/u/B_L_U_E)\
**Post date:** [March 30, 2006, 5:16pm UTC](https://forum.kirupa.com/t/drag-problem/183842/2 "2006-03-30T17:16:36Z")

</div>

Perhaps referencing. try [AS]myButton.onPress = function() {  
\_parent.dragger = attachMovie(“dragger”, “dragger2”, 5);  
\_parent.dragger.\_x = this.\_x  
\_parent.dragger.\_y = this.\_y  
\_parent.dragger.startDrag();  
};  
myButton.onRelease = function() {  
\_parent.dragger.stopDrag();  
};  
[/AS]

---

<div class="post-metadata">

**Author:** ![g5604](https://avatars.discourse-cdn.com/v4/letter/g/54ee81/32.png) [@g5604](https://forum.kirupa.com/u/g5604)\
**Post date:** [March 30, 2006, 6:10pm UTC](https://forum.kirupa.com/t/drag-problem/183842/3 "2006-03-30T18:10:01Z")

</div>

hi, thanks for the reply…

i found that using the onReleaseoutside event worked.
