Home Tutorial Flex Flex4 Components HScrollBar in Flex4

 
 

HScrollBar in Flex4
Posted on: May 13, 2010 at 12:00 AM
The HScrollBar controls is used both in the MX and Spark's component. The HScrollBar control can work as a stand-alone controls, it works combinedly with other compentents as a custom component to provide scrolling functionality.

HScrollBar in Flex4:

The HScrollBar controls is used both in the MX and Spark's component. The HScrollBar control can work as a stand-alone controls, it works combinedly with other compentents as a custom component to provide scrolling functionality. It has four parts: a track, two arrow buttons, and a thumb. The width of this control is equal to the largest width of its subcomponents. The tag of HScrollbar is <s:HScrollbar>.

Example:

 <?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

xmlns:mx="library://ns.adobe.com/flex/mx"

xmlns:s="library://ns.adobe.com/flex/spark">

<s:Panel title="HScrollbar Example" width="281" height="122">

<mx:HBox x="33" y="20" borderStyle="solid">

<s:VGroup>

<s:DataGroup id="item1" left="10" top="20"

clipAndEnableScrolling="true"

itemRenderer="spark.skins.spark.DefaultItemRenderer">

<s:layout>

<s:HorizontalLayout requestedColumnCount="4"/>

</s:layout>

<s:dataProvider>

<s:ArrayCollection>

<fx:String>Label</fx:String>

<fx:String>TextInput</fx:String>

<fx:String>Button</fx:String>

<fx:String>ButtonBar</fx:String>

<fx:String>ComboBox</fx:String>

<fx:String>CheckBox</fx:String>

<fx:String>RadioButton</fx:String>

<fx:String>Image</fx:String>

</s:ArrayCollection>

</s:dataProvider>

</s:DataGroup>

<s:HScrollBar id="hscroll" viewport="{item1}" width="{item1.width}"/>

</s:VGroup>

</mx:HBox>

</s:Panel>

</s:Application>

In this example you can see how we can use a HScrollBar control in Flex4.

Output:

Running Application:

To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.

Download this code

Related Tags for HScrollBar in Flex4:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.