|
Home > Archive > Macromedia Flash Server > May 2005 > FCS Difference between objects
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
FCS Difference between objects
|
|
| Harper, Chris 2005-05-18, 5:49 pm |
| 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:
=20
If (oldData[curRoom].length !=3D newData[curRoom].length){
=20
syncData(); =20
=20
}
=20
But of course that doesn't work :-(
=20
Chris
=-----------------------------------------------------------
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
| |
| JesterXL 2005-05-18, 5:49 pm |
| You can compare objects:
if(a == b)
or:
if(a === b)
But, because objects have properties, your mileage may vary.
Typically, you can test for a specific property, but that naturally doesn't
ensure the rest are the same. For example, you could test the obj.username
and if it matches your version it might be the same... unless your
application allows mutiple usernames, in which case, that's not true... make
sense?
----- Original Message -----
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 != 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/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
| |
| Harper, Chris 2005-05-18, 5:49 pm |
| Duh, why didn't I think of that 
Sometimes I'm too "forrest for the trees". Or maybe I'm just to
forrest... as in Gump!
Thanks Jesty, did the Trick!
-----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
| |
| Harper, Chris 2005-05-18, 5: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
|
|
|
|
|