ScrollPane.content

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX 2004.

Usage

scrollPaneInstance.content

Description

Read-only property; a reference to the content of the scroll pane. The value is undefined until the load begins.

Example

This example sets the contentPath property to load a scroll pane with a picture (or technically, a movie clip containing a JPEG image). It also creates a numeric stepper that the user can increment or decrement by 10, up to a value of 100. When the user changes the value in the NumericStepper, a listener sets the transparency (content._alpha) of the image to the specified percentage. Note that _alpha is a MovieClip property.

You first drag ScrollPane and NumericStepper components from the Components panel to the current document's library and then add the following code to Frame 1:

/**
 Requires:
  - ScrollPane in library
  - NumericStepper in library
*/

System.security.allowDomain("http://www.helpexamples.com");

this.createClassObject(mx.controls.NumericStepper, "my_nstep", 10, {minimum:10, maximum:100, stepSize:10});
my_nstep.value = my_nstep.maximum;

this.createClassObject(mx.containers.ScrollPane, "my_sp", 20);
my_sp.move(0, 30);
my_sp.setSize(180, 160);
my_sp.contentPath = "http://www.helpexamples.com/flash/images/image2.jpg";

var nstepListener:Object = new Object();
nstepListener.change = function(evt_obj:Object) {
 my_sp.content._alpha = my_nstep.value;
}
my_nstep.addEventListener("change", nstepListener);

See also

ScrollPane.contentPath