Add a Script tag, set a variable
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> private function showAge():Number { var myAge:Number = 30; return myAge; } </mx:Script> <mx:Label x="30" y="30" text="{showAge()}" /> </mx:Application>