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);
test is a pointer to a bollean value but w.zoomed is a pointer to a pointer
of a boolean value... I guess...
David Buff
----- Original Message -----
From: "slangeberg" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com>
Sent: Thursday, October 19, 2006 4:32 PM
Subject: Re: [Flashcoders] Boolean question
Correct me if I'm wrong but I believe the Boolean type is still a
primitive
and should not be instantiated with 'new'.
You could perform casting like this:
w = new Object();
w.zoomed = Boolean( false );
But I don't know what benefit it would give, as Flash doesn't support
typing
on the parameters of an Object instance.
Scott
On 10/19/06, Mendelsohn, Michael <[EMAIL PROTECTED]> wrote:
Hi list...
Why does an object's parameter not change if it's instanced as a new
Boolean()?
w = new Object();
w.zoomed = new Boolean(false);
trace (w.zoomed);
//false
w.zoomed = !(w.zoomed);
trace (w.zoomed);
//false
q = new Object();
q.zoomed = false;
trace (q.zoomed);
//false
q.zoomed = !(q.zoomed);
trace (q.zoomed);
//true
Thanks,
- Michael M.
_______________________________________________
Flashcoders@chattyfig.figleaf.com
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
--
: : ) Scott
_______________________________________________
Flashcoders@chattyfig.figleaf.com
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
_______________________________________________
Flashcoders@chattyfig.figleaf.com
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