View comments | RSS feed

ScrollPane.refreshPane()

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX 2004.

Usage

scrollPaneInstance.refreshPane()

Parameters

None.

Returns

Nothing.

Description

Method; refreshes the scroll pane after content is loaded. This method reloads the content, but does not reset the scroll bar. You could use this method if, for example, you've loaded a form into a scroll pane and an input property (for example, a text field) has been changed by ActionScript. In this case, you would call refreshPane() to reload the same form with the new values for the input properties.

Example

This example creates a Refresh button and a ScrollPane instance called my_sp. It loads the ScrollPane with an image and creates a listener for a click event on the button. When a click event occurs, the example calls the refreshPane() function, which reloads the content of the scroll pane.

You first drag the ScrollPane component from the Components panel to the current document's library and then add the following code to Frame 1:

/**
 Requires:
  - ScrollPane component in library
*/

this.createClassObject(mx.controls.Button, "my_button", 10, {label:"Refresh"});
this.createClassObject(mx.containers.ScrollPane, "my_sp", 20);
my_sp.move(0, 30);
my_sp.setSize(360, 280);

var buttonListener:Object = new Object();
buttonListener.click = function(evt_obj:Object) {
 my_sp.refreshPane();
}
my_button.addEventListener("click", buttonListener);

System.security.allowDomain("http://www.helpexamples.com");
my_sp.contentPath = "http://www.helpexamples.com/flash/images/image1.jpg";

Version 8

Comments


Andy Kirkham said on Dec 15, 2006 at 7:42 AM :
What is stated in the Decription is not true: "This method reloads the content, but does not reset the scroll bar. ". In the example code, when you click the Refresh button the picture is reloaded and the scrolling reverts to hPosition = 0, vPosition = 0;

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/8/main/00003988.html