You have to html-encode the ampersand as “&”, the pipe should be fine as it is…

 

<?xml version="1.0" encoding="utf-8"?>

<mx:Application

            xmlns:mx="http://www.adobe.com/2006/mxml"

            layout="horizontal">

           

            <mx:Script>

                        <![CDATA[

                                   

                                    [Bindable]

                                    private var bool1 : Boolean = false;

                                    [Bindable]

                                    private var bool2 : Boolean = true;

                                   

                        ]]>

            </mx:Script>

           

            <mx:Button enabled="{ bool1 &amp;&amp; bool2 }" label="AND operator" />

            <mx:Button enabled="{ bool1 || bool2 }" label="OR operator" />

           

</mx:Application>

 

-Andy

 

_____________________________________

Andrew Trice

Cynergy Systems, Inc.

http://www.cynergysystems.com

 

Blog: http://www.cynergysystems.com/blogs/page/andrewtrice

Email: [EMAIL PROTECTED]

Office: 866-CYNERGY 

 


From: [email protected] [mailto:[email protected]] On Behalf Of boy_trike
Sent: Saturday, November 04, 2006 9:24 AM
To: [email protected]
Subject: [flexcoders] how to handle && and || in mxml

 

I want to be able to enter:
.... enabled = "{varA == 1 && varB == 2}" in my MXML. This does not work. Is there a way
to escape or use the AND/OR in mxml.

thanks

bruce

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to