Call the initDate() function and writes a message in flexlog.txt
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> private function initDate():void { label1.text += new Date(); } </mx:Script> <mx:Box borderStyle="solid"> <mx:Label id="label1" text="Today's Date:" initialize="initDate(); trace('A');" /> </mx:Box> </mx:Application>