Flash Player 6 (6.0 79.0).
Flash MX 2004.
scrollPaneInstance.getBytesLoaded()
None.
The number of bytes loaded in the scroll pane.
Method; returns the number of bytes loaded in the ScrollPane instance. You can call this method at regular intervals while loading content to check its progress.
This example creates a ScrollPane instance called scrollPane. It then defines a listener object called loadListener with a progress event handler that calls getBytesLoaded() to help determine the progress of the load:
createClassObject(mx.containers.ScrollPane, "scrollPane", 0);
loadListener = new Object();
loadListener.progress = function(eventObj){
// eventObj.target is the component that generated the change event
var bytesLoaded = scrollPane.getBytesLoaded();
var bytesTotal = scrollPane.getBytesTotal();
var percentComplete = Math.floor(bytesLoaded/bytesTotal);
if (percentComplete < 5) // loading begins
{
trace(" Starting loading contents from Internet");
}
else if(percentComplete = 50) // 50% complete
{
trace(" 50% contents downloaded ");
}
}
scrollPane.addEventListener("progress", loadListener);
scrollPane.contentPath = "http://www.geocities.com/hcls_matrix/Images/homeview5.jpg";
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/mx2004/main_7_2/00002773.html
Comments
Brando said on Oct 23, 2004 at 8:25 PM :