Archive
This is an archived tutorial about Flash. It's kept for history and may reference outdated tech.
TL;DR
You can hide a scrollbar component until it's needed by setting its _visible property to whether the target text field's maxscroll is greater than 1. Run that check when the movie starts, in the text field's onChanged handler, and after a button copies text into a second field.
- When maxscroll is 1, the scrollbar is disabled; anything greater means there's text to scroll.
- textBox.onChanged fires whenever the input box is modified, so the scrollbar appears as soon as you type enough text.
- The button copies textBox.text into textBox2 and then rechecks scroll2's visibility.
- The scrollbar component isn't in MX 2004, but you can take it from any MX FLA that includes it.
Introduction
Whether it's an input or dynamic text box, many people dread
the look of a disabled scrollbar. This tutorial will teach
you how to apply a simple code to make the scrollbar
invisible when it's not being used.
|
|
[ Type Enough Text to Make the Boxes Scroll ]
Steps to Create Animation
The following steps will help you to create the animation
you see above:
-
Create a new input box, name it
textBox, and change the line type to Multiline.

[ example of an image ]
-
Drag the scrollbar component onto the input
box; give the scrollbar an instance name of scroll1
and make sure the target text field is textBox.

[ example of an image ]
-
Now, it's time to make the second text box, but this time
we're going to make it dynamic; with an instance
name of textBox2 and the line type set to
Multiline.

[ example of an image ]
-
Repeat the process of adding a scrollbar. This time with
an instance name of scroll2 and a target text
field of textBox2

[ example of an image ]
-
The last design step: make a button--similar to the one
above, if you wish. And place it between the two text
boxes.
-
Now it's time to get our hands dirty with some
Actionscript. Add the following code to frame 1 (there
should only be one frame).
-
The final step is to add the following AS to the button.
Code Explanation
Set the text in the bottom text box (textBox2) equal to the text in the top text box (textBox).
textBox.maxscroll
A numeric text box property, that indicates the max value of the property scroll. If this value is 1, the associated scrollbar is disabled. If maxscroll is greater than 1, the scrollbar is enabled.
textBox.onChanged
An action that is called whenever the associated text box is modified.
The scrollbar component has been excluded from MX 2004, but the scrollbar component can be taken from any MX fla that includes the component:
|
If you have any questions, please post them on the kirupaForum.
| Alien (archived resource unavailable) | norie http://www.rastardesigns.com |
Before you go, here are a few things you can do:
-
Keep reading
Read the next article in the series, Creating Drop-Down Menus, or check out some related content:
-
Ask a question
Stuck on something, or curious about a detail we skipped? Ask on the forums, and we’ll help you out.
Just a final word before we wrap up. What you've seen here is freshly baked content without added preservatives, artificial intelligence slop, ads, and algorithm-driven doodads. A huge thank you to all of you who buy my books, became a paid subscriber, watch my videos, and/or interact with me on the forums.
Your support keeps this site going! 😇

-
Hot off the Forums
:: Copyright © KIRUPA 2026 //--
