Would it be possible for you to give me a code example of using getAvatarMovieClipById listed in the documentation.
I know how to get the userID from smartFox.
What I want to do is in some rooms the users shrink 1/2 size. But when a new user enters they are seen full size. I have set a param in smartFox for the user ' size: ' and I can pull that when the avatar enters the room. But what I can't do if target that avatar and set the siz for my avatars view to be correct.
jms
help with getAvatarMovieClipById
doesn't work:(
When trying to use this method, I'm getting
1061: Call to a possibly undefined method getAvatarMovieClipById through a reference with static type com.smartfoxserver.openspace:OpenSpace.
I need this method for several things, mainly to tell my custom avatar class some extra stuff...so I need to get movieClip of each avatar created.
1061: Call to a possibly undefined method getAvatarMovieClipById through a reference with static type com.smartfoxserver.openspace:OpenSpace.
I need this method for several things, mainly to tell my custom avatar class some extra stuff...so I need to get movieClip of each avatar created.
-
- Posts: 40
- Joined: 14 Apr 2010, 17:40
I´m having a similar problem...
I´m trying to use the os.getAvatarById method in my application whenever I click on any avatar so I can access that avatar movieclip:
function onAvatarClicked(evt:AvatarEvent):void
{
trace("--[OpenSpace] Avatar clicked (user id: " + evt.params.id + "; avatar name: " + evt.params.avatarMovieClip.avatarName + ")")
var demoAvatar:DummyAvatarMovieClip = os.getAvatarById(evt.params.id) as DummyAvatarMovieClip
}
but the compiler throws the following error:
1061: Call to a possibly undefined method getAvatarById through a
reference with static type com.smartfoxserver.openspace:OpenSpace.
which is identical to what the poster above had.
I do have the openspace 1 licence, so what gives?
Am I missing a class here?
Fabian Enders
function onAvatarClicked(evt:AvatarEvent):void
{
trace("--[OpenSpace] Avatar clicked (user id: " + evt.params.id + "; avatar name: " + evt.params.avatarMovieClip.avatarName + ")")
var demoAvatar:DummyAvatarMovieClip = os.getAvatarById(evt.params.id) as DummyAvatarMovieClip
}
but the compiler throws the following error:
1061: Call to a possibly undefined method getAvatarById through a
reference with static type com.smartfoxserver.openspace:OpenSpace.
which is identical to what the poster above had.
I do have the openspace 1 licence, so what gives?
Am I missing a class here?
Fabian Enders
-
- Posts: 40
- Joined: 14 Apr 2010, 17:40
Sorry, I didn't notice it before, but you are using the wrong method name: it's getAvatarMovieClipById, not getAvatarById.
Also, there's no need you use that method in your code, because the event params already contain a reference to the avatar movieclip (and you already use it): evt.params.avatarMovieClip
Also, there's no need you use that method in your code, because the event params already contain a reference to the avatar movieclip (and you already use it): evt.params.avatarMovieClip
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
-
- Posts: 40
- Joined: 14 Apr 2010, 17:40
Return to “OpenSpace v1 discussions and help”
Who is online
Users browsing this forum: No registered users and 38 guests