:* Re: [flexcoders] boolean not casting ok from string
i see.
So can i overload the = operator to it understand my needs? So i
can do the converting transparently.
btest:Boolean = false;
i search on google and find it from a forum:
overloading is still not supported in AS3
[mailto:[EMAIL PROTECTED] On Behalf Of Luis
Eduardo
Sent: Wednesday, April 18, 2007 9:06 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] boolean not casting ok from string
yeah shaun, you are rigth. After follow your sugestion i searched in
the docs and found what you mean here:
http
*From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
*On Behalf Of *Luis Eduardo
*Sent:* Wednesday, April 18, 2007 9:06 PM
*To:* flexcoders@yahoogroups.com
*Subject:* Re: [flexcoders] boolean not casting ok from string
yeah shaun, you are rigth. After
@yahoogroups.com
Subject: Re: [flexcoders] boolean not casting ok from string
Gordon and Iko and Hilary,
thx for your assist but i am thinking i am not being very clear on my
previous post. (perhaps my bad english ;)
what i want to do is a typecast from the String true to the boolean
value true
PROTECTED] On Behalf Of Luis
Eduardo
Sent: Thursday, April 19, 2007 7:32 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] boolean not casting ok from string
i see.
So can i overload the = operator to it understand my needs? So i
can do the converting transparently.
btest:Boolean
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
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] wrote:
hi,
this simple code dont work.
var btest:Boolean = new Boolean();
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
;
or
var btest:Boolean;
- Gordon
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Luis
Eduardo
Sent: Wednesday, April 18, 2007 4:54 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] boolean not casting ok from string
hi,
this simple
*From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
*On Behalf Of *Luis Eduardo
*Sent:* Wednesday, April 18, 2007 4:54 PM
*To:* flexcoders@yahoogroups.com
*Subject:* [flexcoders] boolean not casting ok from string
hi,
this simple code
Funny!
On 19/04/2007, at 12:17 PM, Luis Eduardo wrote:
but this not to Boolean:
var numTest:Boolean = Boolean(false);
trace(numtest = +numTest);
var boolVal:String = false;
var numTest:Boolean = boolVal == true;
trace(numtest = +numTest);
Bjorn
Hi,
Its not a bug. Note: the Constructor for Boolean in the docs.
Think about it as if you have the following:
var moo:String = Moo;
if (moo) {
// have a cow.
}else{
//no cow.
}
So, Boolean(false) is true!
var y;
var x:Object;
var b:Boolean = Boolean(false);
trace(b1 false is
yeah shaun, you are rigth. After follow your sugestion i searched in
the docs and found what you mean here:
http://livedocs.adobe.com/flex/201/langref/package.html#Boolean()
Boolean its a function that have the same behavior than the Boolean
constructor that take a non-empty string and
13 matches
Mail list logo