|
|||
|
Im trying to save some user comments to a datafile.
In the comments, the users can make use of komma's. But when saving to the datafile. The sentences containing komma's are split into seperate parts of the array. for example: this array in actionscript Code:
Dag = new Array() Dag[0] = "I like toast, bread, french fries and mayonaise" Dag[1] = "Some other sentence" Code:
[Dag] type=array [Dag.0] type=string value=I like toast [Dag.1] type=string value= bread [Dag.2] type=string value= french fries and mayonaise [Dag.3] type=string value= Some other sentence Seems that the array-parts are joined in Ffish with a "," Is there an easy way around this? Can I use another delimitor? |
|
|||
|
Hmm, hope I am wrong, but I don't think there is much you can do meester.
SWFKit seems to be splitting on the "," SWFKit might need to delimit the array elements with a pipe (|) or double pipe (||) instead? |
|
|||
|
The "getArray" method calls the "getVariable" method to get the value of the array then splits it into seperate parts.
The "getVariable" method will always join the items in an array with ",", we cannot change the delimitor. You can write your own getArray method like this Code:
function myGetArray(name)
{
var arr = [];
var length = parseInt(FlashPlayer.getVariable(name + ".length"));
for (var i = 0; i < length; i++)
{
arr.push(FlashPlayer.getVariable(name + "." + i.toString()));
}
return arr;
}
|
|
|||
|
We cannot implement the "getArray" method in this way.
Eg. In Action Script Code:
Dag = new Array() Dag[0] = "I like toast, bread, french fries and mayonaise" Dag[1000001] = "Some other sentence" |
|
|||
|
The getArray and getObject methods are improved in 2.1 r2.
The getObject method can accept an array parameter contains the property names. The getArray method works like "myGetArray" method if the length of the array is smaller than 5000. |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|