Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scroll Bars in Draggable MC's

Status
Not open for further replies.

Terwin

Programmer
May 23, 2002
51
0
0
US
So,

I have a movie clip that functions as a persistent dialog box, and it contains a dynamic text field with a scroll bar.

The MC is also draggable.

The unfortunate result of this is, that when I attempt to drag in order to scroll, the MC jumps along as well. (Just clicking on the scroll bar DOES work, however).

I tried giving the scroll bar an onClipEvent(mouseDown) to stopDrag the dialog box.. but that seemed to override the scroll bar component's own instructions.. it no longer scrolled at all.

Suggestions?

Thanks,
T
 
I'd add a condition using hitTest to check where the mouse was in relation to the clip and scrollbar before instigating a drag action - don't know how your code is laid out but in general terms this would do it:

onClipEvent(mouseDown){
if (scrollbar.hitTest(_parent._xmouse,_parent._ymouse,true){
//do scroll but not drag;
}else{
//do drag;
}
}
 
The difficulty with that solution is that the "do scroll" part of that is accomplished using private methods that are part of the scrollbar component definition. I'd prefer to not have to recreate scrollbar functionality in its entirety.

If I hitTest and just check for the false condition and then drag, the lack of any scroll instruction in the same conditional check means that the scroll bar will not work.. its onClipEvents will be superceded by those of the parent movie.

T
 
At the risk of being ostracized, I'm going to bump this post -- I still haven't been able to come up with an answer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top