03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Also try to avoid setting checkPolicyFile to true if you are using<br />

MovieClipLoader.loadClip() to download a SWF file. This is because SWF-to-SWF<br />

permissions are not controlled by policy files, but rather by Security.allowDomain(), <strong>and</strong><br />

checkPolicyFile has no effect when you load a SWF file. Checking for a policy file in this<br />

case is wasteful because it may delay the start of your SWF download <strong>and</strong> may consume<br />

network b<strong>and</strong>width unnecessarily. (Flash Player cannot tell whether your main download will<br />

be a SWF file or an image, because the policy file download occurs before the main<br />

download.)<br />

Be careful with checkPolicyFile if you are downloading an object from a URL that may use<br />

server-side HTTP redirects. Flash Player always attempts to retrieve policy files that<br />

correspond to the initial URL that you specify in loadClip. If the final object comes from a<br />

different URL because of HTTP redirects, then the initially downloaded policy file(s) might<br />

not be applicable to the object's final URL, which is the URL that matters in security<br />

decisions.<br />

Availability: <strong>ActionScript</strong> <strong>2.0</strong>; Flash Player 9<br />

getProgress (MovieClipLoader.getProgress method)<br />

public getProgress(target:Object) : Object<br />

Returns the number of bytes loaded <strong>and</strong> the total number of bytes of a file that is being loaded<br />

by using MovieClipLoader.loadClip(); for compressed movies, returns the number of<br />

compressed bytes. The getProgress method lets you explicitly request this information,<br />

instead of (or in addition to) writing a MovieClipLoader.onLoadProgress listener function.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 7<br />

Parameters<br />

target:Object - A SWF, JPEG, GIF, or PNG file that is loaded by using<br />

MovieClipLoader.loadClip().<br />

Returns<br />

Object - An object that has two integer properties: bytesLoaded <strong>and</strong> bytesTotal.<br />

Example<br />

The following example demonstrates the use of the getProgress() method. Rather than<br />

using this method, you will usually create a listener object to listen for the onLoadProgress<br />

event. Also note that the first, synchronous call to getProgress() can return the number of<br />

bytes loaded <strong>and</strong> the total number of bytes of the container <strong>and</strong> not the values for the<br />

externally requested object.<br />

960 <strong>ActionScript</strong> classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!