Using styles with the ScrollPane

The style properties of the ScrollPane component specify values for its skins and padding for its layout when the component is drawn. The various skin styles allow you to specify different classes to use for the component's skins. For more information on using the skin styles, see About Skins.

To set the contentPadding style for a ScrollPane:

  1. Create a new Flash file.
  2. Drag a ScrollPane component to the Stage and give it an instance name of mySp.
  3. Click the Parameters tab in the Property inspector and enter the following value for the source parameter: http://www.helpexamples.com/flash/images/image1.jpg.
  4. On Frame 1 of the main Timeline, add the following code to the Actions panel.
    mySp.setStyle("contentPadding", 5);
    

    Note that the padding is applied between the component's border and its content, on the outside of the scroll bars.

  5. Select Control > Test Movie.