Home Tutorial Flex Flex4 Components Spinner in Flex4

 
 

Spinner in Flex4
Posted on: May 12, 2010 at 12:00 AM
Flex4 introduced a new a Spinner control which was not available in MX. In Flex4 Spinner control is called a Spark component.

Spinner control in Flex4:

Flex4 introduced a new a Spinner control which was not available in MX. In Flex4 Spinner control is called a Spark component. You can set the values and select the values by clicking up and down button in Spinner control. The tag of Spinner control is <s:Spinner>.

Example:

 <?xml version='1.0' encoding='UTF-8'?>

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

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

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

<s:Panel title="Spinner Control Example" x="0" y="0" width="278" height="250">

<s:VGroup width="240" height="197" left="26" top="10">

<s:HGroup>

<mx:Text text="Use the arrows to change tabs:"/>

<s:Spinner id="spinner1" maximum="3"/>

</s:HGroup>

<mx:TabNavigator id="tabnav" width="230" height="75%"

 selectedIndex="@{spinner1.value}">

<mx:HBox label="C">

<s:Label text="C is a procedural based language."/>

</mx:HBox>

<mx:HBox label="JAVA">

<s:Label text="JAVA is a object oriented language."/>

</mx:HBox>

<mx:HBox label="HTML">

<s:Label text="HTML is used for designing a web page."/>

</mx:HBox>

<mx:HBox label="ORACLE">

<s:Label text="ORACLE is a database."/>

</mx:HBox>

</mx:TabNavigator>

</s:VGroup>

</s:Panel>

</s:Application>

In this example you can see how we can use a Spinner 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 Spinner 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.