Usage
Usage 1:
on(scroll){
...
}
Usage 2:
listenerObject = new Object();
listenerObject.scroll = function(eventObject){
...
}
UIScrollBarInstance.addEventListener("scroll", listenerObject)
Description
Event; broadcast to all registered listeners when the mouse is clicked (released) over the scroll bar.
The
UIScrollBar.scrollPosition
before this event is broadcast.
The first usage example uses an
component instance. The keyword
refers to the component instance. For example, the following code, attached to the UIScrollBar
component instance
the Output panel:
on(scroll){
trace(this);
}
The second usage example uses a dispatcher/listener event model, in which the script is placed on
a frame in the Timeline that contains the component instance. A component instance
(
UIScrollBarInstance
function, also called a handler, on a listener object (
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 (
the listener object method. The event object has properties that contain information about the
event. You can use these properties to write code that handles the event. Finally, you call
addEventListener()
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 (
the
event includes a third property named
scroll
a string describing which way the scroll bar is oriented. The possible values for the
property are
vertical
For more information about the
on page
415.
838
Chapter 6: Components Dictionary
property and the scroll bar's onscreen image are updated
handler and must be attached directly to a UIScrollBar
on()
, used inside an
this
myUIScrollBarComponent
) dispatches an event (in this case,
(see
EventDispatcher.addEventListener()
(the default) and
horizontal
and
type
handler attached to a component,
on()
, sends "_level0.myUIScrollBarComponent" to
scroll
listenerObject
and
type
. The
direction
.
event object properties, see
target
) and the event is handled by a
) that you create. You define
eventObject
) on the component
), the event object for
target
property contains
direction
direction
"Event objects"
) to
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?