-
SFS avatar changing
Hi,
I need help with changing what the avatar (disc) looks like. If you are familiar with the avatarChat example then you will know that the disc is the picture. The disc is a movie clip located inside the avatar movie clip. My question is how would I change it. I have tried on (release){
mc.disc.gotoAndPlay ("next");
}
I need a lot of help!
Please answer ASAP. (I am making a Virtual World)
Last edited by afel; 07-06-2012 at 04:16 PM.
Reason: Misspelling
-
Designer, Programmer, Musician
If the script is on the main timeline:
Actionscript Code:
mc.disc.gotoAndPlay ("next");
}
If the script is inside the avatar movieclip:
Actionscript Code:
disc.gotoAndPlay ("next");
}
If the code is inside the disc movieclip:
Actionscript Code:
_root.mc.disc.gotoAndPlay ("next");
}
Any of these should work. Let me know.
-
Reply
Well the only problem is that the avatar is not in the scene. It is in the library then SmartFoxServer loads it in.
-
Designer, Programmer, Musician
Hum...i dont know anything about flash servers/multiplayer/gaming platforms. I know what it is, but i dont know how it works, and how it works together with flash. Sorry
-
Okay Thanks anyway. Have a good day!
-
Designer, Programmer, Musician
No problem
Maybe you can explain how this flash-flash server communication works? so we can help you with this? How this server pick up the content and distribute it for multiplayers games? What script and content do you have in your fla?
-
What do you mean by that?
-
Designer, Programmer, Musician
Ok, if the avatar movieclip is on the library, export it for actionscript with an instance name. I suppose that your avatar's instance name is "mc" right? And the disc movieclip instance name is "disc"? And the disc movieclip is on the stage, in the first frame of the avatars movieclip timeline? Let me know
-
Well after the "connect" frame it goes to the "chat" frame. On the chat frame the code loads the avatar (That is it's instance name) from the library into the "chat" frame. It has to be done that way. You can't drag the avatar onto the stage.
-
Client Software Programmer
for avatar chat you not only need to switch the frame you will have to tell smartfox server you are changing it, smart fox has a setUserVariables() command heres an example make a random button and put this code in it:
on (release) {
var newCol = 4;
_root.smartfox.setUserVariables({col:newCol, init:true});
_root.myAvatar.disc.gotoAndStop(newCol);
}
the number 4 means its going to the fourth frame of your character so switch that to what ever frame you want your avatar to change to.
also if you just want to reach your avatar client side you would _root.myAvatar.disc.whateveryouwant
Last edited by AS3.0; 07-08-2012 at 03:12 PM.
-
Thank You So Much!
@Basses6
You are a complete life saver! I am so happy! Thanks!!!
-
Client Software Programmer
-
Issue?
Hi. Now when another user joins the game their name doesn't show. Please help! Also the change frame on the avatar doesn't let other people see it unless they reload the page.
Last edited by afel; 07-08-2012 at 08:07 PM.
Reason: Added Another Question
-
Client Software Programmer
Can you post your avatar chat file only the .fla maybe I can see if you messed anything up.
-
Link
Okay here is the link to my Chat fla. www.mediafire.com/?mxnljs6t7rygc4c
It also might be messed up with my config?
Thanks
-
Client Software Programmer
I cant open the .Fla, im using flash 9 (cs3) maybe you have a higher version than me? If you have cs3 please export it as flash 9 :P
-
-
Client Software Programmer
Can you publish as cs3 "flash 9" just click File>Publish_settings>Flash>version>9
If not than idk was the name problem before the button I gave you or after
-
Can't make a CS5 fla become a CS3 of flash 9.
-
Client Software Programmer
than I cant help you any further :/
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|