The Flash runtime doesn't provide any native UI controls (button, scrollbar, combobox, etc) so you must either use or write components developed in AS3.
Adobe Flash Professional includes a set of UI components; the Flex framework offers many (and heavyweight) components but you must go Flex from the ground up. Both have serious pros and cons but at least their code is interesting to study.
You'll find plenty of (often bad) scrollbar scripts around the web - this is a good exercice to learn Flash.
Please note that you have 2 ways of scrolling text:
- TextFields have a scroll property to scroll text line by line,
- or set a mask (or better a scrollRect) to scroll arbitrary contents including a long TextField.
if you add flex_sdk_4.1\frameworks\libs\framework.swc
to SWC libraries (at project properties -> compiler options) you may import and use mx.controls.VScrollBar
You're going to have to develop one yourself, or find a free solution online. It will generally involved a very high textfield that's revealed only partly due to a mask. The scroll bar then controls the Y position of the textfield, so the mask reveals different parts of the textfield.
精彩评论