Skip to main content
Known Participant
March 1, 2010
Question

How best to provide a link from inside a ScrollPane?

  • March 1, 2010
  • 3 replies
  • 517 views

I have a movie clip (named "panel") which contains a scrollpane (named "ScrollPane). Within this scrollpane is a movie clip named "textmovie".

In "textmovie" is a whole lot of text which you can scroll from top to bottom utilizing "ScrollPane". I would like to add a link within this great amount of text that will provide a small, borderless pop-window which will define the word which you clicked. There is only one word which needs to be defined, so I don't need a dynamic text box or anything fancy like that. I need a simple text box to appear.

I could'nt find anything too simple, so i thought I would just add a frame into "textmovie" which will have the box appear. When someone clicks the word (via an invisible button) the movie would go to frame 2 (making the text box appear). When the mouse is clicked again, the movie will go back to frame one.

Again, this whole thing would be scrollable as it is a movie clip inside a scrollpane.

The only problem is, any button I place in "textmovie" seems to not be accessible when viewing the "panel" swf. Its as if the button is too many layers deep to be recognized by the mouse click.

You can click and drag on the content within the scrollpane to make it scroll. When you click-and-hold on top of the invisible button (which I would like to make the "textmovie" play to frame 2, the entire contents of the scrollpane will scroll up and down. This is what tells me that the invisible button is behind the scrollpane layer, not allowing the button in "textmovie" to be clicked.

Any ideas how to make this button in "textmovie" clickable?

Thank you.

This topic has been closed for replies.

3 replies

Known Participant
March 1, 2010

Set the scrolldrag parameter to false.

Known Participant
March 1, 2010

BAHhhhhhh!

I figured it out. All it took was setting the scrolldrag parameter to false.This takes away that "layer" on top of the ScollPane which prevents any buttons underneath from being accessed.

Thank you for your responses, kglad. I always appreciate your help.

kglad
Community Expert
Community Expert
March 1, 2010

you're welcome.

kglad
Community Expert
Community Expert
March 1, 2010

the scrollpane will probably intercept mouse events so you'll need to use a loop and hittest to determine when something within the scrollpane is clicked.

Known Participant
March 1, 2010

Hi kglad,

Thanks for the response.

Will I still be able to define the coordinates for the hittest in the "textmovie" movie clip, as this is the content which is scrolled inside the ScrollPane?

Known Participant
March 1, 2010

and a follow-up question.

So it should be as simple as creating an invisible movieclip over the word I would like defined within the "textmovie" movie clip, and then putting this script within the first frame of the invisible movie clip:

onClipEvent(mouseDown){
  if(this.hitTest(_root._xmouse, _root._ymouse))
    {
      [instructions to be executed on a good hit];
    }
}

Does that look like it will take to make mouse clicks register within "textmovie" inside of the ScrollPane?

Thanks, again!