Did you try it?  I would expect that to work.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: [email protected] [mailto:[email protected]] On Behalf 
Of Angelo Anolin
Sent: Thursday, September 17, 2009 8:10 PM
To: [email protected]
Subject: [flexcoders] Label Control Text Value Coming From a Function Call


Hi FlexCoders,

I have a label control where the text value that should be displayed is coming 
from a defined function.

   For example:

   <mx:Label id="LabelDay1" text="" horizontalCenter="true" />

   private function setDayName(monthNo:Number, dayNo:Number, 
yearNo:Number):String
   {
 // Make some calculations on the day based on the date parameter passed.
 //......
 .....

 //Assuming the day value is returned after parsing the date value parameters.
 return 'Monday'
   }

   Is it possible to assign that the LabelDay1 object would display in the text 
the value returned by the function setDayName.  Please take note that I have a 
lot of instances of the label control which is inside a datagrid column 
control's header renderer so placing them in a function outside would be 
tedious.

   Would this be possible:

   <mx:Label id="LabelDay1" text="{setDayName(1,1,2009)}" 
horizontalCenter="true" />

   Appreciate your response. Thanks.

Regards,

Angelo


Reply via email to