Setting up Custom User Icon

Everything about the SmartFoxBits UI Components for SmartFoxServer 1.x. Post your questions, suggestions and bug reports.

Moderators: Lapo, Bax

MLife
Posts: 1
Joined: 22 Mar 2010, 21:11

Setting up Custom User Icon

Postby MLife » 22 Mar 2010, 21:19

hi, i've been working with SFS for a few weeks now.

I've created a game lobby and I would like to implement Facebook to it.
So far it's worked to create a connection with facebook, so now my username becomes my full name (got it from facebook).

Now I would like to change the CustomUserIcon to my profilepicture from facebook.
I can retrieve the link to my profilepicture, but I can't change my CustomUserIcon.

In older versions of SFS (AS 2.0) the method returns a String. In AS 3, you get this: setCustomUserIcon(item:Object):Class

then you return customUserIcon. I'm able to convert that string into a movieclip via the Loader function. But how should i create a class from that.


I'm confused.
I hop you guys can help me.
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 24 Mar 2010, 13:49

In Flex, the iconFunction of a List control (used inside the UserList component) requires a Class to be returned.
You probably need to use the getClassByDefinition method, to retrieve the class. Check the Adobe documentation for more informations.
Also, check this page: http://cookbooks.adobe.com/post_Get_definition_by_object_instance-12946.html
Paolo Bax
The SmartFoxServer Team
Haniman
Posts: 35
Joined: 02 Sep 2009, 22:52

Postby Haniman » 01 Nov 2010, 15:58

Hey, i have a kinda similar problem.

I want to load a picture from my server and show it as custom icon, is that somehow possible with the UserlistBit ? Or do i have to build my own custom itemrenderer?

I tried this

Code: Select all

var imgSource:String =sfsProxy.getUploadPath()+user.getName()+".jpg";
var image:Image = new Image();
image.source = imgSource;      
var displayObjectDefinition:Class = Object(image).constructor;
return  displayObjectDefinition;

but it dosent work. Is there another way passing my image the sourcepath i want to use ?
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 01 Nov 2010, 16:12

Create a custom item renderer.
Paolo Bax
The SmartFoxServer Team
Haniman
Posts: 35
Joined: 02 Sep 2009, 22:52

Postby Haniman » 01 Nov 2010, 16:54

What a pitty, i liked the Bit :D

Thanks for the fast reply!

Return to “SmartFoxBits for SFS 1.x”

Who is online

Users browsing this forum: No registered users and 5 guests