View comments | RSS feed

ScrollPane.hPosition

Availability

Flash Player 6 (6.0 79.0).

Edition

Flash MX 2004.

Usage

scrollPaneInstance.hPosition

Description

Property; the pixel position of the scroll pane's horizontal scroll box (thumb). The 0 position is at the extreme left end of the scroll track, which causes the left edge of the scroll pane content to be visible in the scroll pane.

Example

This example positions the scroll bar at pixel 20:

scrollPane.hPosition = 20;

Comments


hypoStiller said on Mar 16, 2005 at 6:45 AM :
At best, the descriptions of hPosition and vPosition are misleading; at worst, they're simply incorrect. Neither actually refers to the pixel position of the scroll pane's scroll box (scrollThumb), as stated.

This is easy to test. Draw a horizontal "ruler" with markings every 20 pixels and set this as the contentPath of your ScrollPane instance. Now scroll sideways until the first marking has been scrolled out of sight. This means 20 pixels have been scrolled: it is *this* number that hPosition refers to. The scrollThumb may or may not be 20 pixels from the edge of its scrollBar.
djtechwriter said on Mar 16, 2005 at 4:38 PM :
hypostiller,

Thanks for noting this. I've updated the docs to clarify each property.Both the hPosition and vPosition properties orient the scroll pane's contents relative to the scroll pane, offset by the number of pixels assigned to the property.
This example positions the contents of the scroll pane offset to the left by 20 pixels:
scrollPane.hPosition = 20;

Since the scrollThumb responds to the content's position, the scrollThumb position changes, too. However, the scrollThumb's position changes proportionally to the content, not in absolute pixels as the above description suggests.

 

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