View comments | RSS feed

ScrollPane.complete

Availability

Flash Player 6 (6.0 79.0).

Edition

Flash MX 2004.

Usage

Usage 1:

on(complete){
   ...
}

Usage 2:

listenerObject = new Object();
listenerObject.complete = function(eventObject){
   ...
}
scrollPaneInstance.addEventListener("complete", listenerObject)

Description

Event; broadcast to all registered listeners when the content has finished loading.

The first usage example uses an on() handler and must be attached directly to a ScrollPane instance. The keyword this, used inside an on() handler attached to a component, refers to the component instance. For example, the following code, attached to the ScrollPane instance myScrollPaneComponent, sends "_level0.myScrollPaneComponent" to the Output panel:

on(complete){
   trace(this);
}

The second usage example uses a dispatcher/listener event model. A component instance (scrollPaneInstance) dispatches an event (in this case, complete) and the event is handled by a function, also called a handler, on a listener object (listenerObject) that you create. You define a method with the same name as the event on the listener object; the method is called when the event is triggered. When the event is triggered, it automatically passes an event object (eventObject) to the listener object method. Each event object has properties that contain information about the event. You can use these properties to write code that handles the event. Finally, you call the EventDispatcher.addEventListener() method on the component instance that broadcasts the event to register the listener with the instance. When the instance dispatches the event, the listener is called.

For more information, see EventDispatcher class.

Example

The following example creates a listener object with a complete event handler for the scrollPane instance:

form.complete = function(eventObj){
   // insert code to handle the event
}
scrollPane.addEventListener("complete",form);

Comments


N8s said on May 4, 2005 at 7:36 AM :
I did a lot of looking into this problem because I had a real need to use the scroll pane. What I did was to use the movie clip loader class. It's built in progress and complete works with I.E. (even on a slow dial-up connection). So use the movie clip loader class to load your files. Once it is loaded, you can use the on complete comand to load the scroll pane. The scroll pane's on complete will fire correctly (if you still need it to) because the movie is already loaded. I have tested this on several platforms, browsers and connections speeds and seems to work as it should.
jepo said on Jun 6, 2005 at 7:42 PM :
Thank you for your comments. This site is for documentation feedback only. Some comments with general questions about how to use components, bug reports, or feature requests for the Flash product, have been removed. Please use the Flash webforums for questions about how to use components: http://webforums.macromedia.com/flash. Please use this form for feature requests or suspected bugs: www.macromedia.com/support/email/wishform/.
mike6496 said on Jun 28, 2005 at 11:35 AM :
this seems to only apply to content loaded from an external source. i.e. if content is loaded from the library into the scrollpane the "complete" event is not fired..
squared99 said on Jul 21, 2005 at 4:03 PM :
For objects loaded from the library with contentPath, the "load" event seems to be more reliable than "complete". All UI child objects like ScrollPane inherit the load event, as well as many others.

 

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/00002770.html