Hey
I am trying to use the "params" array returned from hendleRequest() in an ActionScript Room extension.
I can access the array and navigate it, but commands such as unshift, join, pop or concat do not work properly...
Also if I trace the array itself (without cycling through values) the output on the adimn panel is a strange string: "[Ljava.lang.String;@1522de2"
How can I hanlde the params array?
thx!
P
Using the "params" array in "handleRequest()&
- Pippoflash
- Posts: 135
- Joined: 30 Jan 2006, 17:16
- Contact:
Ah! Very nice question!
They don't work because the object you get is a native Java array, not an Actionscript array.
We might hide this from the Actionscript framework... Let me think about it a little bit more.
A Java array is a very simple (and veeeery fast) data structure. It only has one property called length, like in AS
But no other methods.
So there's no unshift, join etc...
You can cycle through it just like you would do with an AS array but if you need to use the other methods you will have to convert it to a real AS array.
Example:
They don't work because the object you get is a native Java array, not an Actionscript array.
We might hide this from the Actionscript framework... Let me think about it a little bit more.
A Java array is a very simple (and veeeery fast) data structure. It only has one property called length, like in AS
But no other methods.
So there's no unshift, join etc...
You can cycle through it just like you would do with an AS array but if you need to use the other methods you will have to convert it to a real AS array.
Example:
Code: Select all
function arrayConvert(javaArray)
{
var asArray = []
for (var i = 0; i < javaArray.length; i++)
asArray[i] = javaArray[i]
return asArray
}
- Pippoflash
- Posts: 135
- Joined: 30 Jan 2006, 17:16
- Contact:
The great, unsurpassable Rhino by Mozilla group
http://www.mozilla.org/rhino/
http://www.mozilla.org/rhino/
Return to “Server Side Extension Development”
Who is online
Users browsing this forum: No registered users and 33 guests