Hi,
Is there any method to check when the avatar has actually been added from inside the avatar class. I am trying to attach an event listener to the stage to check for mouse move so that I can rotate the avatar to the mouse.
I have tried adding the evt listener in the init method of the avatar but it cannot access the stage at this point (presumably because the avatar has not been added yet).
Is there a function that I am missing?
Thanks
Avatar added to stage
You can't listen to the event inside the avatar; you just have the init method, but as you pointed out, it is not enough.
The possible solution is to add a method to your avatar class and call it from outside when the avatar creation event is dispatched by OpenSpace.
The possible solution is to add a method to your avatar class and call it from outside when the avatar creation event is dispatched by OpenSpace.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Okay, Thanks...
I have managed to access my avatars function by using the following
Is there a cleaner method of accessing the methods inside my avatar?
Thanks
I have managed to access my avatars function by using the following
Code: Select all
var avatarClass:Class = WorldVals.os.avatarAppDomain.getDefinition("FootballerAvatar") as Class;
var avatar:* = WorldVals.os.getMyAvatar() as avatarClass;
avatar.throwBalloon();Thanks
Why not the following simplified method?
Code: Select all
var avatar:FootballerAvatar = WorldVals.os.getMyAvatar() as FootballerAvatar;
avatar.throwBalloon();
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team