ActionScript 2.0 Components Language Reference |
|
|
|
| ScrollPane component > ScrollPane.contentPath | |||
Flash Player 6 (6.0.79.0).
Flash MX 2004.
scrollPaneInstance.contentPath
Property; a string that indicates an absolute or relative URL of the SWF or JPEG file to load into the scroll pane. A relative path must be relative to the SWF file that loads the content.
If you load content using a relative URL, the loaded content must be relative to the location of the SWF file that contains the scroll pane. For example, an application using a ScrollPane component that resides in the directory /scrollpane/nav/example.swf could load contents from the directory /scrollpane/content/flash/logo.swf by using the following contentPath property: "../content/flash/logo.swf"
The following example shows how to set the contentPath property to load a ScrollPane from three different sources: 1) an image on the Internet; 2) a movie clip in the library; 3) a SWF file from the current working directory. Use only one source at a time.
You first drag the ScrollPane component from the Components panel to the current document's library. To try option 2, you must create a movie clip in the library and reference its name. To try option 3, create a SWF file in the current working directory and specify its name. Then add the following code to Frame 1:
/**
Requires:
- ScrollPane on Stage (instance name: my_sp)
- Symbol with Linkage ID of "movieClip_Name" in the library ** optional
- logo.swf file in the working directory ** optional
*/
System.security.allowDomain("http://www.helpexamples.com");
var my_sp:mx.containers.ScrollPane;
// method 1: JPEG image
my_sp.contentPath ="http://www.helpexamples.com/flash/images/image1.jpg";
// method 2: Symbol in library
my_sp.contentPath ="movieClip_Name";
// method 3: SWF file
my_sp.contentPath ="logo.swf";
|
|
|
|