05-18-05 10:49 PM
Okay, I actually got around to making a test but it doesn't seem to
work.
Here is my code:
/////////////////////////////////////
obj1 =3D new Object();
obj1["test"] =3D new Object();
obj1["test"]["user1"] =3D new Object();
obj1["test"]["user1"].room =3D "room1";
obj1["test"]["user1"].id =3D 123;
obj2 =3D new Object();
obj2["test"] =3D new Object();
obj2["test"]["user1"] =3D new Object();
obj2["test"]["user1"].room =3D "room1";
obj2["test"]["user1"].id =3D 123;
obj3 =3D new Object();
obj3["test"] =3D new Object();
obj3["test"]["user1"] =3D new Object();
obj3["test"]["user1"].room =3D "room1";
obj3["test"]["user1"].id =3D 123
obj3["test"]["user2"] =3D new Object();
obj3["test"]["user2"].room =3D "room1";
obj3["test"]["user2"].id =3D 1234;
if (obj1 =3D=3D obj2){=09
trace ("obj1 is equal to obj2");=09
} else {=09
trace ("obj1 is not equal to obj2");=09
}
if (obj2 =3D=3D obj3){=09
trace ("obj2 is equal to obj3");=09
} else {=09
trace ("obj2 is not equal to obj3");=09
}
//////////////////////////////////////////
And it outputs:
obj1 is not equal to obj2
obj2 is not equal to obj3
//////////////////////////////////////////
Am I missing something?
-----Original Message-----
From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.
org] On Behalf Of JesterXL
Sent: Wednesday, May 18, 2005 1:22 PM
To: FlashComm Mailing List
Subject: Re: [FlashComm] FCS Difference between objects
You can compare objects:
if(a =3D=3D b)
or:
if(a =3D=3D=3D b)
But, because objects have properties, your mileage may vary.
Typically, you can test for a specific property, but that naturally
doesn't=20
ensure the rest are the same. For example, you could test the
obj.username=20
and if it matches your version it might be the same... unless your=20
application allows mutiple usernames, in which case, that's not true...
make=20
sense?
----- Original Message -----=20
From: "Harper, Chris" <Chris.Harper-OaAI/70wYEY@public.gmane.org>
To: <flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>
Sent: Wednesday, May 18, 2005 2:57 PM
Subject: [FlashComm] FCS Difference between objects
This isn't strictly a FCS question but I was wondering if anybody knew
how to tell if two objects are different in flash. I've been trying to
do something like:
If (oldData[curRoom].length !=3D newData[curRoom].length){
syncData();
}
But of course that doesn't work :-(
Chris
Supported by Fig Leaf Software - http://www.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailma...fo/flashcomm=20
=3D-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=3D-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
[ Post a follow-up to this message ]
|