Avatar params

Post here your questions about the OpenSpace 2.x or notify bugs and suggestions.

Moderators: Lapo, Bax

neekychan
Posts: 2
Joined: 24 Jul 2011, 04:21

Avatar params

Postby neekychan » 24 Jul 2011, 04:30

Hi.There is my question.
i want to create a avatar with a picture from server.
first. i have got a bytearray from server(Pic Datas)
second.i create a AvatarCreationParams,and i pass the bytearray to the skin property.(skin.byte = bytes , skin.sex = "man")
third.when the class avatar call the init method.
it say.skin.byte is null.
But,the skin.sex is ok!("man")

I guess the Openspace will not send skin.bytes to my client.except String.

please give me an answer.
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 25 Jul 2011, 12:06

As described in the IOpenSpaceAPI.setMyAvatarSkin() method API documentation, the valid types are strings, numbers, booleans, arrays and objects.
Paolo Bax
The SmartFoxServer Team
neekychan
Posts: 2
Joined: 24 Jul 2011, 04:21

Postby neekychan » 27 Jul 2011, 01:39

I know.
I have fix it like this.
But I want to show the IMG in init process.
Not after the avatar create and call setSkin().

I just don't know why the skin.byte is null in init process except name or sex(String).
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 27 Jul 2011, 08:58

Byte arrays are not supported by the skin object.
Instead of passing the image data, you should pass its linkage name and then instantiate a class contained in the swf file itself (or in another one loaded by the main one) using the AS3 getDefinition method.
Paolo Bax
The SmartFoxServer Team

Return to “OpenSpace v2 discussions and help”

Who is online

Users browsing this forum: No registered users and 49 guests