The Flex 4 SDK provides a set of classes and user interface (UI)
components to facilitate rapid and standardized development. The fourth
iteration of the SDK has been designed to enable the use of Flex 3 (Halo)
components as well as Flex 4 (Spark) components based on the new
architecture. By default, the Spark and Halo components are differentiated
mx namespaces, respectively. For
<s:Button id="sparkButton"/> <mx:Button id="haloButton"/>
This use of XML namespaces enables developers to switch between the new Spark components and the legacy Halo components. Additionally, it improves the readability of the code. Although many Spark components have Halo counterparts and the two can often be used interchangeably, it is recommended that you use the Spark versions when possible as they are most likely to be supported by future iterations of the Flex SDK.
You need to perform a task in response to user interaction, such as outputting a list of names to the console when the user clicks a button.
click event attribute
s:Button tag to assign a
handler for the event in MXML. Alternatively, in ActionScript, use the
addEventListener() method on the
button instance to assign a listener for the
The following code shows how to listen for a button click by using
MXML to assign a handler for the
click event attribute of the
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" ...