Add ActionScript code in the component's definition for initialize event : Event « Event « Flex
- Flex
- Event
- Event
Add ActionScript code in the component's definition for initialize event

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Box borderStyle="solid">
<mx:Label id="label1" text="Today's Date:" initialize="label1.text += new Date();" />
</mx:Box>
</mx:Application>
Related examples in the same category