Hi Jerry-

I use Cairngorm.

I would specify a property in a bindable final MyModel like so:

public var labelVisible:Boolean;

MyModel is then referenced as a property on bindable MyModelLocator (Singleton) 
like so:

public var myModel:MyModel;

I then would make my custom component with the following in the script block:

<fx:Script>
 <![CDATA[
   
   import com.myPackage.MyModelLocator;

   [Bindalbe] public var myModelLocator:MyModelLocator;
  
   ]]>
</fx:Script>

So now when I instantiate my custom component I pass in MyModelLocator and then 
I can then use this variable in the label easily:

<Label
 id="myLabel"
 visible="{myModelLocator.myModel.labelVisible}"/>

You should do your processing in a distinct separate AS3 class to manipulate 
mModelLocator.myModel.labelVisible within that class.  Et Viola, the changes 
percolate prefectly.

Hope this sheds some light.

-Naga


--- In flexcoders@yahoogroups.com, "Davidson, Jerry" <jerry.davidson@...> wrote:
>
> I want to change the visible property to a control in a component.
> Where would I do that?  It doesn't seem to work in a script tag at the
> top of the component and I don't know how to reach that control from a
> script elsewhere.
> 
>  
> 
> I have an app with an input form (state 1).  When you click a button on
> it, various computations happen and the result form is displayed (state
> 2).
> 
>  
> 
> I want to either hide or display  a control depending on the data from
> the computation.  It is a label.  The value in the text field (bound
> from a VO) next to it is what I use to make that decision. 
> 
>  
> 
>  
> 
> Jerry
>


Reply via email to