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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scrolling Pane 1

Status
Not open for further replies.

bgreenhouse

Technical User
Feb 20, 2000
231
CA
Hi Folks

I know how to make a text box have a scrollbar, but how do you do it with a movieclip? I want to have a movieclip that has a scrollbar that lets you look move the mc up and down. Do I have to use a mask, or can I just do some sort of "on press change the y coordinate of the movieclip" - making sure that the movieclip is either off the stage as it moves or beneath other layers...

I hope this question makes sense - I know what I'm trying to say!

B
 
To start you off:

Regards,

oldman3.gif
 
scrollbars in mx work fine with mc's. in fact using them for textboxes is to to able to use only a few of the available properties.
a good bet may to be get 'scroller 1.0.6' from just enter the name of the movieclip in the components parameters and off you go.
 
Perfect - thanks guys, that's what I was looking for.

B
 
OldNewbie: using that example, how do you reference the scroll content in the scroll pane using dot notation? I used to just use "main_stage1.gotoandPlay()" (or whatever). Now I have given the scroll pane the instance name "scrollPane", and given the content mc the linkage identifier "main_stage". I've tried _root.scrollPane.main_stage.gotoandPlay() (scrollPane is on the root..), _root.main_stage.gotoand..., main_stage.gotoand..., etc, but nothing seems to work. Any suggestion (these are in a change handler for a Ftree component, they're not actions on the mc itself...).

Any help is appreciated!

Thanks

B
 
var content = scrollPane.getScrollContent();
content.gotoAndStop(4);

I think that will work - any other way though?

Thanks

B
 
The content movie is referred to as tmp_mc, so something like this should work.

_level0.myscrollpane.tmp_mc.gotoAndPlay("frame_label"); Regards,

oldman3.gif
 
Alright, here's another question on this topic - if anyone's still listening. The movieclip that is the content of the scroll pane has dynamic data pulled from XML. As data gets pulled in, elements on the page get moved up and down to allow for larger text blocks, etc. (it's a list). How can I make it so that the size of htat movieclip gets larger as necessary, but is no larger than required - hence stopping the pane from scrolling when unnecessary...

Thanks

Ben
 
I guess I stumped you guys - or no one's listening any more...;o).

B
 
I'm listeing but not at all familiar with XML stuff, so I can't really recreate your situation.
Wouldn't the mc expand as you put it... "...elements on the page get moved up and down to allow for larger text blocks..." Regards,

oldman3.gif
 
Thanks oldnewbie - let me explain a bit better. Basically, it's an mc that consists of about 15 headings, that are followed by content that is pulled out of XML. Where it comes from is irrelevant (i.e. XML or .txt, etc.). I have written a script that moves each heading up or down depending on the amount of content below the heading above it. So if all content is empty, the mc might only be 15 "lines" high. However, if you add multiple paragraph content below one of the headings it pushes the content below it down. I thought the mc would expand, but my scroll bar goes all the way to the bottom, and some text is still cut off - text that shows up if less content is present higher up.

It's probably also important to note that I am repositioning these elements by keeping a running total of the height of each of the dynamic text fields holding the content. I then add that running total to the _y property of the field below, moving it down that much. I think I am moving it off of the stage of the movie clip - if that's possible.

Make any more sense?

B
 
Hi oldnewbie

I hadn't tried that, but now I have. It doesn't seem to fix the problem - although I've left it in there as I'm sure it's a good thing to have. The scrollPane seems to have a maximum distance it can scroll down. This maximum distance doesn't seem to have anything to do with the content of the scroll pane. I've tried putting in a large box that is as large as the mc will ever be - taking away the possibility that the dynamic repositioning of text boxes is the cause - and it still is cut off! I can't even figure out where the scrollPane is getting the "size" from. It doesn't seem to be analogous to anything in my movie. If this gets frustrating enough, I'll post the clip and see if anyone has some bright ideas.

Thanks,

B

 
Okay, I feel like an idiot. oldnewbie - you were right. The refresh pane was the key, I just forgot to put an uppercase letter in the instance name of my scrollpane...When I clued into that it worked. You'd think I'd have learned my lesson after the first 500 times making hta tmistake ;o). Thanks for all your help!

B
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top