Because a Boolean instance is evaluated as an object. Boolean(object)
should return true.
var myBool:Boolean = new Boolean(false);
var myObject:Object = new Object();
trace([myBool, Boolean(myBool), !myBool, typeof myBool]);
// Output: false,true,false,object
trace([myObject, Boolean(myObject), !myObject, typeof myObject]);
// Output: [object Object],true,false,object
_____
David Buff wrote:
I think it's because q.zoomed = false create a memory space where the
boolean value "flase" is stored, and q.zoomed is a pointer witch point
to this memory space.
New Boolean(false) create also a memory space and a pointer, but with
w.zoomed = new Boolean(false) , w.zoomed point to the pointer of the
value and don't point to the value. So you can do !Boolean but not
!Pointer(of boolean)...
w = new Object();
w.zoomed = new Boolean(false);
trace (w.zoomed);
//false
w.zoomed = !(w.zoomed);
trace (w.zoomed);
//false
test = !(w.zoomed);
trace(test);
Good luck,
--
Fumio Nonaka
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
My books<http://www.FumioNonaka.com/Books/index.html>
Flash community<http://F-site.org/>
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com