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!

Deactivate scroll bar? 1

Status
Not open for further replies.

Schteve

Programmer
Mar 29, 2005
14
0
0
US
I'm using a custom scroll bar, as I don't like how MX's component one works. But basically, I want to be able to "deactivate" the scroll bar (probably by loading dimmed images in place of it) when the text in the text box is short enough where no scrolling is necessary. So my question is, is there some sort of built in function (or one I can put in) that can tell if the text in a textbox is long enough to be scrolled or not?

While I'm on the subject, my ideal scroll bar would function just like the component one, only the thumb wouldn't resize based on the amount that can be scrolled.; the thumb would be an image that remains a constant size throughout. It would still need to scroll when you click the up or down buttons or the scroll track, though (and the thumb would move to wherever you clicked on the track). Anyone know a tutorial or something that can show me how to do this with the images I want? Or if it helps, I have a flash file with different images that works exactly how I want it to, but it moves a movieclip up or down rather than scrolling a textbox. If I gave someone the file could they modify it to work on a textbox?
 
hey schteve

post your file I will have a look, but it doesnt seem like something that cannot be done :)


W i K
 
Included in the zip file is the flash as well as the text document it imports text from; that way you will see how it is supposed to work (for another working example, go to and click enter, then when the flash loads, click updates).
As I said, this file works by creating multiple textboxes within a movie clip, and then scrolling the whole movie clip until you see the last textbox. Each textbox in it has its own component scroll bar, but I'm only concerned with the big one on the left. The code was way to advanced for me, and I just got it from somewhere else. :S

Many thanks for your help!
 
FYI, I solved my first problem. I put a the "deactivated" images behind my up and down buttons, which then contained this code:

onClipEvent (enterFrame) {
if (_parent.body.maxscroll == 1) {
this._visible = false;
}
}

so that when there's nothing to scroll, they disappear and look to be deactivated. I still need help with the whole thumb and track thing, though, so I still need help making the flash I posted earlier work on scrolling textboxes.
 
Unexpected file format! Can't open your .fla.
You'd have a better chance of getting an answer if your .fla was in a MX only format, and zipped up.

You would have to save a copy of your MX2004 .fla, (using Save as...) and changing the Document type to MX only in the Save as... window.


Regards. Affiliate Program - Web Hosting - Web Design
After 25,000 posts, banned on FK, but proud not to have bowed down to them!
 
That's how it was saved. The only thing I can think of that'd cause that to happen is the fact that it's set to export in Flash 6, even though it was written in 7. I don't know where the problem lies, but something in the code doesn't work when the movie is exported in 7. Anyhow, I did reupload the file (same link as before) and took out some of the unnecessary things in it.
 
Nope! I'm saying you should save a copy of your MX2004 .fla (under another name) in a MX only format (you have to use Save As and change the Document type in the Saves As window), and make sure the saved copy is not in the application when you zipped it up and upload the copied .fla in a new zip.

Regards. Affiliate Program - Web Hosting - Web Design
After 25,000 posts, banned on FK, but proud not to have bowed down to them!
 
Yeah, I can open this one... But now what's the question?
It seems to be doing what I understood, you were asking in your initial post... So is it just a question of loading the text from an external text file, rather than having it already typed up in the textfield itself, or what?

Regards. Affiliate Program - Web Hosting - Web Design
After 25,000 posts, banned on FK, but proud not to have bowed down to them!
 
No, what I want is the scroll bar in the flash to scroll the texbox. Currently, it is moving a movie up and down that contains a textbox. It'd be perfect if you could modify it to scroll the text properly, or at least point me in the right direction on how to go about doing it.

Thanks.
 
I still don't understand what you're looking for?
Rather than controlling a movie clip, you want it to contol a simple textfield?

But will the textfield be typed in or loaded from a text file?

Regards. Affiliate Program - Web Hosting - Web Design
After 25,000 posts, banned on FK, but proud not to have bowed down to them!
 
"Rather than controlling a movie clip, you want it to contol a simple textfield?"
---------
Yes, that is what it should do with text loaded from a text file. The version I gave you, however, has text already typed in, and is thus not the same; I didn't think it would make any difference to how it scrolls.
 
This what you're sort of looking for?

Loads a text from a text file into a textfield within a movie clip... Automatically adjusts the scrolling range according to the length of the text. Fixed thumb size & click on scrolltrack working. Speed can be adjusted.


Regards. Affiliate Program - Web Hosting - Web Design
After 25,000 posts, banned on FK, but proud not to have bowed down to them!
 
Yes! There are a few minor things I'd adjust, like how the scrolling speeds up then slows down towards the end, but I'm sure it's nothing I can't manage myself. Do you have the .fla file of that uploaded?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top