MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 839

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

Example
The following code implements Usage 1. The code is attached to the UIScrollBar component
instance and sends a message to the Output panel when the user clicks the scroll bar. The
handler must be attached directly to the UIScrollBar instance.
on(scroll){
trace("UIScrollBar component was clicked");
}
The following example implements Usage 2 and creates a listener object called
a
event handler for the
scroll
myListener = new Object();
myListener.scroll = function(eventObj){
// insert code to handle the "scroll" event
}
verticalScroll.addEventListener("scroll", myListener);
UIScrollBar.scrollPosition
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
Usage
scrollBarInstance.scrollPosition
Description
Property; gets or sets the current scroll position of the scrollable text field. The position of the
scroll box (thumb) also updates when a new
scrollPosition
horizontal scrolling.
If the UIScrollBar instance is being used for vertical scrolling (the most common use), the value
of
scrollPosition
equal to the total number of lines in the text field divided by the number of lines that can be
displayed in the text field simultaneously. If
range, the text field simply scrolls to the end of the text.
To scroll the text to the first line, set
To scroll the text to the end, set
minus 1. You can determine the number of lines by retrieving the value of the
property of the text field.
If the UIScrollBar instance is being used for horizontal scrolling, the value of
an integer value ranging from 0 to the width of the text field, in pixels. You can determine the
width of the text field in pixels by getting the value of the
The default value of
verticalScroll
depends on whether the UIScrollBar instance is being used for vertical or
is an integer with a range that begins with 0 and ends with a number that is
scrollPosition
scrollPosition
is 0.
scrollPosition
instance of the UIScrollBar component:
value is set. The value of
scrollPosition
is set to a number greater than this
scrollPosition
to 0.
to the number of lines of text in the text field
maxhscroll
on()
myListener
maxscroll
scrollPosition
property of the text field.
UIScrollBar component
with
is
839

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents