|
Home > Archive > Macromedia Flash Server > June 2005 > shared object array
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 |
shared object array
|
|
|
| I'm trying to delete an element from an array on a shared object "vids_so".
something like this :
function del_element_so(string){
var l =3D vids_so.data.vArray.length;
for(var i:Number =3D 0;i <=3D l;i++){
if (vids_so.data.vArray[i] =3D=3D string){
vids_so.data.vArray.splice(i,1,string);
//trace(vids_so.data.vArray.splice(index,1,string));
}
}
}
Can anybody tell me where is my bug ?
Many thx !!!
=-----------------------------------------------------------
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
| |
| daz lee 2005-06-23, 5:49 pm |
| the <=3D should be < and once you have found it=20
if (vids_so.data.vArray[i] =3D=3D string){
vids_so.data.vArray.splice(i,1,string);
break;
add a break, you have no need to continue
also, its bad practise to call somet string, use str or something.
----- Original Message -----=20
From: John<mailto:outsourcer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>=20
To: =
flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>=20
Sent: 23 June 2005 19:44
Subject: [FlashComm] shared object array
I'm trying to delete an element from an array on a shared object =
"vids_so".
something like this :
function del_element_so(string){
var l =3D vids_so.data.vArray.length;
for(var i:Number =3D 0;i <=3D l;i++){
if (vids_so.data.vArray[i] =3D=3D string){
vids_so.data.vArray.splice(i,1,string);
//trace(vids_so.data.vArray.splice(index,1,string));
}
}
}
Can anybody tell me where is my bug ?
Many thx !!!
=3D---------------------------------------------------------
Supported by Fig Leaf Software - =
http://www.figleaf.com<http://www.figleaf.com/>
=3D---------------------------------------------------------
To change your subscription options or search the archive:
=
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm<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
| |
| daz lee 2005-06-23, 5:49 pm |
| oh sorry also, splice(i,1,string); should be splice(I, 1);
----- Original Message -----=20
From: John<mailto:outsourcer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>=20
To: =
flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org<mailto:flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org>=20
Sent: 23 June 2005 19:44
Subject: [FlashComm] shared object array
I'm trying to delete an element from an array on a shared object =
"vids_so".
something like this :
function del_element_so(string){
var l =3D vids_so.data.vArray.length;
for(var i:Number =3D 0;i <=3D l;i++){
if (vids_so.data.vArray[i] =3D=3D string){
vids_so.data.vArray.splice(i,1,string);
//trace(vids_so.data.vArray.splice(index,1,string));
}
}
}
Can anybody tell me where is my bug ?
Many thx !!!
=3D---------------------------------------------------------
Supported by Fig Leaf Software - =
http://www.figleaf.com<http://www.figleaf.com/>
=3D---------------------------------------------------------
To change your subscription options or search the archive:
=
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm<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
|
|
|
|
|