Something like this:

<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";>

<mx:Script>
   <![CDATA[
    var someval:Number = 1;
    var otherval:Number = 2;
    function disable() {
     if (someval == otherval) {
      myButton.enabled = true;
     } else {
      myButton.enabled = false;
     }
    }
   ]]>
</mx:Script>

<mx:Button id="myButton" label="Test button" />

<mx:Button click="disable(event)" label="Click to disable first button" />

</mx:Application>


joao_m_fernandes wrote:
> 
> Hi there,
> 
> This may be a basic question.
> 
> I know that if I use <mx:Button enabled="{someval == otherval}"/>
> My button will be enabled whenever someval = otherval is true.
> 
> How can I set this kind of conditional values to a button created with
>  ActionScript ? 
> 
> Thanks,
> 
> Joćo Fernandes
> 
> 
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
> 

-- 

--------------------------------------------
Stephen Milligan
Code poet for hire
http://www.spike.org.uk

Do you cfeclipse? http://cfeclipse.tigris.org


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to