gl0om wrote:And what if I use DemoVatar class in my project? Compilator will stuck on line where the reference on DemoAvatar is.
The solution I used was getting DemoAvatar class definition from loaded swf file's application domain.
Code: Select all
private var DemoAvatar:Class;
private var myAvatar:*;
private function onAvatarSwfLoaded(evt:Event):void
{
DemoAvatar = avatarAppDomain.getDefinition('DemoAvatar') as Class;
myAvatar = openSpace.getMyAvatar() as DemoAvatar;
}
So every time I needed to use my DemoAvatar's methods I called them through myAvatar. But I'm sure there is simpler way to do this.