MACROMEDIA FLASH 8-COMPONENTS LANGUAGE Reference page 1205

Components language reference
Table of Contents

Advertisement

Description
Event; broadcast to all registered listeners when the mouse button is clicked (released) over the
scroll bar. The
UIScrollBar.scrollPosition
are updated before this event is broadcast.
The first usage example uses a dispatcher/listener event model, in which the script is placed on
a frame in the that contains the component instance. A component instance
(
textAreaInstance
function, also called a handler, on a listener object (
define a method with the same name as the event on the listener object; the method is called
when the event occurs. When the event occurs, it automatically passes an event object
(
) to the listener object method. The event object has properties that contain
eventObject
information about the event. You can use these properties to write code that handles the
event. Finally, you call
on the component instance that broadcasts the event to register the listener with the instance.
When the instance dispatches the event, the listener is called.
In addition to the normal properties of the event object (
for the
event includes a third property named
scroll
contains a string describing which way the scroll bar is oriented. The possible values for the
property are
direction
For more information about the
on page
499.
The second usage example uses an
component instance. The keyword
component, refers to the component instance. For example, the following code, attached to
the TextArea component instance
"_level0.myTextAreaComponent" to the Output panel:
on (scroll) {
trace(this);
}
Example
This example uses the dispatcher/listener event model to track when the user scrolls the
TextArea using the TextArea instance's scroll bars or scroll box.
) dispatches an event (in this case,
addEventListener()
(the default) and
vertical
and
type
handler and must be attached directly to a TextArea
on()
, used inside an
this
myTextAreaComponent
property and the scroll bar's onscreen image
) and the event is handled by a
scroll
listenerObject
(see
EventDispatcher.addEventListener()
and
type
direction
horizontal
event object properties, see
target
handler attached to a
on()
, sends
) that you create. You
), the event object
target
. The
property
direction
.
"Event objects"
TextArea.scroll
)
1201

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents