Mega Code Archive

 
Categories / Flex / Data Model
 

Modify Label text through data binding

<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" height="200"     width="200">     <mx:Script>                  [Bindable]         public var varOne:String = "This is a public variable";         public function setVarOne(newText:String):void {             varOne=newText;         }            </mx:Script>     <mx:Label id="lblOne" text="I am here" />     <mx:Label text="{varOne}" />     <mx:Button label="Nested Button" click="setVarOne('Nested button pressed.');" /> </mx:Application>