Send request ByteArray

Post here your questions about the HTML5 / JavaScript for SFS2X

Moderators: Lapo, Bax

ttienqb
Posts: 5
Joined: 24 May 2016, 08:39

Send request ByteArray

Postby ttienqb » 25 May 2016, 09:09

Hi
In htm5/javascript, i send request type ByteArray then at server, take string different in mobile request.
exmaple:
In mobile: {"action":0,"command":20,"cards":[9]}
in html5/javascript: {"action":0,"command":20,"cards":{"Compressed":false,"BytesAvailable":1,"Length":1,"Position":0,"Bytes":[9]}}
see different "cards":
my code:
ByteArray byteArray = new ByteArray((byte[])objParam);
obj.PutByteArray(keyParam, byteArray);
how to fix that?
thank advance
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Send request ByteArray

Postby Lapo » 25 May 2016, 14:28

Hi,
I am not sure how can you send a ByteArray via Javascript API. We don't support direct use of ByteArrays.

What are you trying to send? What kind of data is it?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
ttienqb
Posts: 5
Joined: 24 May 2016, 08:39

Re: Send request ByteArray

Postby ttienqb » 26 May 2016, 02:05

it's type byte[].
example: i try send byte array id about cards. byte[] {1,3,4}.
But i must to convert from byte[] to ByteArray. to putByteArray follow syntax.
So, can u help me to fix ??
thank
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Send request ByteArray

Postby Lapo » 26 May 2016, 08:29

As I have explained, byte arrays are not supported in the HTML 5 API as of this moment.

I would simply recommend to send the cards id as numbers, instead of bytes.

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X HTML5 / JavaScript API”

Who is online

Users browsing this forum: No registered users and 17 guests