ScrollPane.scrollDrag

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX 2004.

Usage

scrollPaneInstance.scrollDrag

Description

Property; a Boolean value that indicates whether scrolling occurs (true) or not (false) when a user drags within the scroll pane. The default value is false.

Example

This example creates a ScrollPane instance called my_sp, loads it with an image, and sets the scrollDrag property to true, allowing the user to scroll by dragging the image within the scroll pane.

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";

// Enable scrolling by dragging scroll pane.
my_sp.scrollDrag = true;