User Guide

1122 ScrollPane component
You first drag the ScrollPane component from the Components panel to the current
document’s library and then add the following code to Frame 1:
/**
Requires:
- ScrollPane component in library
*/
this.createClassObject(mx.containers.ScrollPane, "my_sp", 10);
my_sp.setSize(360, 280);
System.security.allowDomain("http://www.helpexamples.com");
my_sp.contentPath = "http://www.helpexamples.com/flash/images/image1.jpg";
// Scroll 100 pixels when clicking on horizontal bar.
my_sp.hPageScrollSize = 100;
// Create listener object.
var spListener:Object = new Object();
spListener.scroll = function(evt_obj:Object):Void {
trace("hPosition = " + my_sp.hPosition + ", vPosition = " +
my_sp.vPosition);
};
// Add listener.
my_sp.addEventListener("scroll", spListener);
ScrollPane.vScrollPolicy
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX 2004.
Usage
scrollPaneInstance.vScrollPolicy
Description
Property; determines whether the vertical scroll bar is always present ("on"), is never present
(
"off"), or appears automatically according to the size of the image ("auto"). The default
value is
"auto".