On Apr 12, 2010, at 10:31 AM, Doug wrote:

> I seem to have little success with this and would like to know other ways of 
> accomplishing what I want to do.
> 
> I'm trying to enable/disable a button based on two pieces of criteria.  It 
> would seem that a logical OR or a logical AND would bridge these much like an 
> IF statement, however, I'm struggling to make it work 100%.
> 
> Consider a button:
> 
> <s:Button enabled="{showMe || hideMe}"/>
> 
> This button's enabled property is based upon the binding of the variables for 
> "showMe" and "hideMe".  If showMe or hideMe is true then the button is 
> enabled.  This works fine when using a logical OR.  However, the following - 
> using a logical AND - does not:
> 
> <s:Button enabled="{showMe && hideMe}"/>
> 
> How do you do a logical AND??  Also, if I wanted to set showMe and hideMe 
> based on several lines of code how would I best do it?  How would you bind a 
> function output to a display object?  I only see a way to do it based upon 
> event:
> 
> [Bind (event: <some event here>]
> private function myFunction():void{}
> 
> Thanks in advance!!

I haven't tried this, but I suspect that you are being bitten by XML. Try this:

<s:Button enabled="{showMe &amp;&amp; hideMe}"/>

--
Rick Genter
[email protected]

Reply via email to