Code Collision

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

I also have a draggable window script running too:


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

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

Im stumped.

http://proto.layer51.com/d.aspx?f=845 :wink:

  • 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.

yup… it is that simple. =)

by the way, welcome to kirupa forum!! :wink:

SEARCH FIRST! :scream:

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]

^ 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

don’t worry about “freeposting” kirupaforum.com has all the space we need…

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

(im bad, I know)

:thread moved to random:

:wink:

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

MovieClipInstanceName.beginDrag();

yeah beginDrag tries to be just like startDrag but named different and ‘better’ :slight_smile:

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:

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?

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

then when you want to drag a movieclip, instead of

instanceName.startDrag();
instanceName.stopDrag();

you use

instanceName.beginDrag();
instanceName.endDrag();

got it? =)

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


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:

startDrag(_root.caption, true);

to

beginDrag(_root.caption, true);

and then captions do not work… good grief …LOL

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

:stuck_out_tongue: :wink:

HA! worked like a charm!

yup. :wink: =)

beginDrag(target, …)

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