Loader.contentPath

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX 2004.

Usage

loaderInstance.contentPath

Description

Property; a string that indicates an absolute or relative URL of the file to load into the loader. A relative path must be relative to the SWF file that loads the content. The URL must be in the same subdomain as the loading SWF file.

If you are using Flash Player or test mode in Flash, all SWF files must be stored in the same folder, and the filenames cannot include folder or disk drive information.

Example

The following example tells the loader instance to display the contents of the logo.swf file:

flower.contentPath = "http://www.flash-mx.com/images/image1.jpg"

The following example unloads content from the Loader when the button instance my_btn is clicked:

flower.contentPath = "http://www.flash-mx.com/images/image1.jpg"
function clicked(){
    flower.contentPath = "";
}
my_btn.addEventListener("click", clicked);