Archive for September, 2009
Data Binding with Components
Definition:
It is used to tie data in one object to another. That is, it is used to pass data
between different layers of the application. There are three ways to use
DataBinding. They are,
1. {} syntax
2. <mx:Binding> tag
3. BindingUtils static methods
The requirements for this DataBinding are source property, destination
property & an event.
Source Code:
<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml”
layout=”absolute”>
<mx:TextInput id=”myText” x=”315″ y=”251″/>
<mx:Label text=”{myText.text}” x=”315″ y=”294″/>
</mx:Application>
With Regards
Hemakumar.S
Creating ToolTip
Definition:
All visual components that extend the UI component class support a tool tip
property. When a mouse pointer hovers over the component, the string
appears in the tool tip.
Source Code:
<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml”
creationComplete=”initApp()” layout=”absolute”>
<mx:Script>
<![CDATA[
import mx.controls.TextInput;
public function initApp():void
{
var myTextInput:TextInput = new TextInput();
myTextInput.toolTip = ” This is a TextInput Control”;
addChild(myTextInput);
}
]]>
</mx:Script>
</mx:Application>
With Regards
Hemakumar.S