Would the problem be the manner in which I am invoking it?

<mx:DataGridColumn width="90" headerText="Status" dataField="status">

<mx:itemRenderer>

<mx:Component>

<mx:VBox 

width="100%" height="100%" 

horizontalAlign="center" verticalAlign="middle"

>

<mx:Label text="{statusToImage('abc')}" />

</mx:VBox>

</mx:Component>

</mx:itemRenderer>

</mx:DataGridColumn>



  ----- Original Message ----- 
  From: Roman Protsiuk 
  To: [email protected] 
  Sent: Thursday, January 11, 2007 9:11 AM
  Subject: Re: [flexcoders] New to Flex - dynamic text in mx:Label?


  Hi, Alex.

  Tried your example. It works. %)

  However, maybe what you need is something like this:

      [Bindable]
      protected function get someText() : String {
          return _someText;
      }
      
      protected function set someText(value : String) : void {
          _someText = statusToImage(value);
      }
      
      private var _someText : String;

  and:

      <mx:Label text="{someText}" /> 

  This seems pretty flexible to me.

  R.



  On 1/11/07, Alex <[EMAIL PROTECTED]> wrote:
    Hi there,

    Given this function:

    <mx:Script> 
    <![CDATA[

    private function statusToImage(data:String):String { 
    return "test"; 
    }

    ]]>
    </mx:Script>

    How precisely can I set it as text-generator for a label? I've tried:

    <mx:Label text="{statusToImage('abc')}" />

    And Flex Builder writes: "1180: Call to a possibly undefined method
    statusToImage.".

    Seems it's right above in the same mxml file though!

    Thanks in advance.
    Alex






   

Reply via email to