# Code Collision

**URL:** <https://forum.kirupa.com/t/code-collision/22849>\
**Category:** flash\
**Created:** [June 9, 2003, 4:49pm UTC](https://forum.kirupa.com/t/code-collision/22849 "2003-06-09T16:49:20Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![brooklyniteOne](https://avatars.discourse-cdn.com/v4/letter/b/8dc957/32.png) [@brooklyniteOne](https://forum.kirupa.com/u/brooklyniteOne)\
**Post date:** [June 9, 2003, 4:49pm UTC](https://forum.kirupa.com/t/code-collision/22849/1 "2003-06-09T16:49:20Z")

</div>

First off I would like to say thank you to the contributors to this site and boards it has helped me alot in my flash endeavors. This site is great compared most of the sites out there. Cheers!

In any case, heres my problem:

I have the **hover captions** app from the tutorial on this site thing going on in the root of my movie found here:

[http://www.kirupa.com/developer/mx/captions.htm](http://www.kirupa.com/developer/mx/captions.htm)

I also have a **draggable window** script running too:

```auto

on (release) {
tellTarget ("/my_win") {
play ();
}
}
 

Code for Drag Button:

on (press) {
startDrag ("/my_win", true);
}
on (release) {
stopDrag ();
}

Code for Close Button:

on (release) {
gotoAndStop (1);
}

```

now thew problem is that after I drag the draggable window the captions get all screwey and dont hover over the correct positions. :-\

you can see it here:

[http://www.hotphish.net](http://www.hotphish.net)

Click the book with the questionmark then hover over the nav.

Im stumped.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 9, 2003, 5:00pm UTC](https://forum.kirupa.com/t/code-collision/22849/2 "2003-06-09T17:00:06Z")

</div>

[http://proto.layer51.com/d.aspx?f=845](http://proto.layer51.com/d.aspx?f=845) 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 9, 2003, 5:05pm UTC](https://forum.kirupa.com/t/code-collision/22849/3 "2003-06-09T17:05:18Z")

</div>

- fixed the wrap issue on my first post LOL

but basically that is saying to use BEGINDRAG (and ENDDRAG) as analternative to startDrag and stopDrag. Is it that simple? can it be? Or do I need to edit ALL the code.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 9, 2003, 5:06pm UTC](https://forum.kirupa.com/t/code-collision/22849/4 "2003-06-09T17:06:45Z")

</div>

yup… it is that simple. =)

by the way, welcome to kirupa forum!! 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 9, 2003, 5:19pm UTC](https://forum.kirupa.com/t/code-collision/22849/5 "2003-06-09T17:19:57Z")

</div>

SEARCH FIRST! 😱

err…

I mean, don’t be a stranger :love:

[edit]… ok the effectiveness of this post just diminished with the deletion of the prior post lol [/edit]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 9, 2003, 5:33pm UTC](https://forum.kirupa.com/t/code-collision/22849/6 "2003-06-09T17:33:48Z")

</div>

^ LOL they wont get it.

I deleted that post it cuz I didnt want to freepost. freeposters have my DB enourmous and I hate pruning…lol

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 9, 2003, 5:34pm UTC](https://forum.kirupa.com/t/code-collision/22849/7 "2003-06-09T17:34:58Z")

</div>

don’t worry about “freeposting” [kirupaforum.com](http://kirupaforum.com) has all the space we need…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 9, 2003, 5:37pm UTC](https://forum.kirupa.com/t/code-collision/22849/8 "2003-06-09T17:37:40Z")

</div>

\<------ more than just this much ---------\>

(im bad, I know)

:thread moved to random:

😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 10, 2003, 12:49am UTC](https://forum.kirupa.com/t/code-collision/22849/9 "2003-06-10T00:49:10Z")

</div>

but where in that “beginDrag” code do I specify the instance name of the clip I need to drag?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 10, 2003, 12:55am UTC](https://forum.kirupa.com/t/code-collision/22849/10 "2003-06-10T00:55:09Z")

</div>

```auto
MovieClipInstanceName.beginDrag();

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 10, 2003, 1:45am UTC](https://forum.kirupa.com/t/code-collision/22849/11 "2003-06-10T01:45:01Z")

</div>

yeah beginDrag _tries_ to be just like startDrag but named different and ‘better’ 🙂

The code provided is the behind the scenes workhorse. A good idea is just making a new layer for it and pasting it in the first there just to forget about it from then on out. Then, instead of using startDrag, use beginDrag in its place.

:beam:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 10, 2003, 1:49am UTC](https://forum.kirupa.com/t/code-collision/22849/12 "2003-06-10T01:49:39Z")

</div>

yeah I put the main code from that site above in the first frame of the \_root (nice site by the way), I changed all instances of “MovieClip.prototype” to “my\_win” wich is the instance name of the clip I want to move and still no dice… what gives?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 10, 2003, 1:57am UTC](https://forum.kirupa.com/t/code-collision/22849/13 "2003-06-10T01:57:10Z")

</div>

no!! just paste the whole script as is. do **not** change/edit/replace anything!!

then when you want to drag a movieclip, instead of

```auto
instanceName.startDrag();
instanceName.stopDrag();

```

you use

```auto
instanceName.beginDrag();
instanceName.endDrag();

```

got it? =)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 10, 2003, 2:36am UTC](https://forum.kirupa.com/t/code-collision/22849/14 "2003-06-10T02:36:41Z")

</div>

ok thanks … I got it to work (drag) with the following code:

```auto

on (press) {
        beginDrag ("/my_win", true);
}
on (release) {
        endDrag ();
}

```

But the captions are still screwy… as they were with the startDrag code.

I tried to change:

```auto
startDrag(_root.caption, true);

```

to

```auto
beginDrag(_root.caption, true);

```

and then captions do not work… good grief …LOL

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 10, 2003, 2:46am UTC](https://forum.kirupa.com/t/code-collision/22849/15 "2003-06-10T02:46:48Z")

</div>

```auto
on (press) {
_root.my_win.beginDrag(true);
}
on (release) {
_root.my_win.endDrag();
}

```

```auto
_root.caption.beginDrag(true);

```

😛 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 10, 2003, 2:59am UTC](https://forum.kirupa.com/t/code-collision/22849/16 "2003-06-10T02:59:40Z")

</div>

HA! worked like a charm!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 10, 2003, 3:01am UTC](https://forum.kirupa.com/t/code-collision/22849/17 "2003-06-10T03:01:30Z")

</div>

yup. 😉 =)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 10, 2003, 10:23am UTC](https://forum.kirupa.com/t/code-collision/22849/18 "2003-06-10T10:23:26Z")

</div>

beginDrag(target, …)

oops! you know I didnt even think about that method! I never use anything like that anymore 😛 Ill add that in!
