It's more efficient to simply write btest = testValue == "true"; The right-hand-side already evaluates to true or false, so there is no need to add ? true : false. - Gordon
________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Hilary Bridel Sent: Wednesday, April 18, 2007 5:18 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] boolean not casting ok from string try: var btest:Boolean; var testValue:String = "true"; btest = testValue == "true" ? true : false; trace("btest = "+btest); Hilary -- On 4/19/07, Luis Eduardo <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: hi, this simple code dont work. var btest:Boolean = new Boolean(); btest = "true"; trace("btest = "+btest); btest = "false"; trace("btest = : "+btest); there are a compile warning telling me that: "3590: String used were a Boolean value was expected. The expression will be type coerced to Boolean" but it is not. even if i do typecast it wont work: btest = Boolean("true"); trace("btest = : "+btest); or if i typecast with "as". btest = ("true" as Boolean); btest = ("false" as Boolean); so i ask: how to cast String "true" to Boolean true ? what am i missing??? Luís Eduardo. -- Hilary --