Question about Avatar Assets

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

Moderators: Lapo, Bax

Biff_Cornwall
Posts: 29
Joined: 07 Aug 2009, 17:54

Question about Avatar Assets

Postby Biff_Cornwall » 12 Aug 2009, 19:38

In the OpenSpace.initialize() method, do you have to pass a swf file that contains all of the avatar skins? We were thinking of putting each individual skin, (i.e. a shirt) in it's own swf file and pulling in only what we need at runtime when we build the avatar.

If we can do this, how would we handle the OpenSpace.initialze() method when we don't have a single swf file with all the avatar assets in it?

Or, do we have to have all avatar skins (shirts, pants, hair, eyes, etc) in one swf file?

Thanks,
Biff
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 13 Aug 2009, 06:42

As you can see in the our AvatarMovieClip example, each avatar skin part instance is created like this:

Code: Select all

var avatarPart:Class = getDefinitionByName(avatarClassName) as Class

Definitions are retrieved from the application domain of the external file (passed in the initialize method). This is not mandatory. You could instead change your AvatarMovieClip class so that specific swf files are loaded depending on the required skins.
Of course, being the loading an asynchronous process, you will probably see the avatar parts appear on the screen with some lag.
Paolo Bax
The SmartFoxServer Team
Biff_Cornwall
Posts: 29
Joined: 07 Aug 2009, 17:54

Postby Biff_Cornwall » 13 Aug 2009, 13:16

Thanks for the reply Bax.

How you're explaining it is exactly how we plan to do it, however, the initialize() method requires two paramaters: an instance of the SmartFoxServer, and an avatarsLibrary. If we don't have one single library to pass because we've broken everything out, how do we handle the avatarsLibrary parameter of the initialize() method?

Or maybe I'm confused as to what the avatarsLibrary parameter requires?

Thanks,
Biff
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 13 Aug 2009, 13:48

You can pass your application's root. Check the API documentation of the initialize method.
Paolo Bax
The SmartFoxServer Team
sstark
Posts: 77
Joined: 21 Nov 2008, 16:06

Postby sstark » 13 Aug 2009, 15:27

I made a master avatar manager package (.swc), and changed the Avatar swf to call the methods from my avatar manager, treating it more like an API than anything.

I hope that helps.

Return to “OpenSpace v1 discussions and help”

Who is online

Users browsing this forum: No registered users and 11 guests