Hi,
the example you provided is the same as before, and unfortunally i get the same results from it
The only thing i get from the avatar is this output:
"AVATAR CREATION ERROR: Missing 'DemoAvatar' class definition in avatars application domain for 'demo' avatar type "
although i think i got everything like mentioned in the documentation.
A pratical example would be nice, since there seems to be alot of questions regarding this matter.
Thnks for que quick reply, i am using the 1st aproach, but in the meanwhile i reviewed the code and found that i missed something after ive loaded the swf file at runtime in my application i was forgetting to set the Openspace avatarAppDomain property
Now its working
package
{
import com.smartfoxserver.openspace.engine.model.avatar.Avatar;
import com.smartfoxserver.openspace.shared.view.items.Tile;
import flash.geom.Rectangle;
import flash.display.*; // This import is required or Flash CS3 won't be able to compile; no issues with CS4 instead
public class DemoAvatar extends Avatar
{....
I suppose you are using the "external library" approach. In this case you probably have an issue with the application domain in which you load the avatars swf file. As the IOpenSpace.avatarAppDomain property description says in the client API reference, that application domain must have the main application domain as its parent. Otherwise OpenSpace will "see" a different Avatar class definition which doesn't match with the one you are extending in your avatar.
bax wrote:In this case you probably have an issue with the application domain in which you load the avatars swf file. As the IOpenSpace.avatarAppDomain property description says in the client API reference, that application domain must have the main application domain as its parent.
gl0om,
DemoAvatar.as is the class definition linked to a movieclip in the DemoAvatarContainer.fla file. Are you able to compile that fla to a swf file, without errors?
bax wrote:Are you following the "external library" approach correctly, creating the application domain in which you load the swf correctly?
I'm not sure. Here's my code
...
Not sure? Did you read my earlier post in which I describe the two approaches?
Anyway, as you are loading an external SWF file, you are using an external library.
DemoAvatar.as doesn't contain a definition of myAvatarSymbol and avatarGraphics because those are movieclips inside the DemoAvatar movieclip contained in the DemoAvatarContainer.fla file.
bax wrote:
Not sure? Did you read my earlier post in which I describe the two approaches?
Anyway, as you are loading an external SWF file, you are using an external library.
DemoAvatar.as doesn't contain a definition of myAvatarSymbol and avatarGraphics because those are movieclips inside the DemoAvatar movieclip contained in the DemoAvatarContainer.fla file.
Yes, I did. As it works fine now, I suppose that I did everything well. But I can't understand why my project should be compiled without definition of myAvatarSymbol and avatarGraphics in DemoAvatar.as. My project simply don't know about these objects in DemoAvatar.swf and compilator tells me that it can't find these objects in DemoAvatar.as
My project simply don't know about these objects in DemoAvatar.swf and compilator tells me that it can't find these objects in DemoAvatar.as
You don't have to include DemoAvatar.as in your main project. It is used when you compile your avatar library swf file, so it takes those myAvatarSymbol and avatarGraphics definitions from there.
Nepaleno wrote:
You don't have to include DemoAvatar.as in your main project. It is used when you compile your avatar library swf file, so it takes those myAvatarSymbol and avatarGraphics definitions from there.
And what if I use DemoVatar class in my project? Compilator will stuck on line where the reference on DemoAvatar is. Because in DemoAvatar.as it'll find the implementation of myAvatarSymbol, but this myAvatarSymbol is defined in SWF file, not in DemoAvatar.as ...
I suppose that compilator doesn't check SWF file for possible definitions, or it does?