A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 28

Thread: SFS avatar changing

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    14

    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

  2. #2
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    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.

  3. #3
    Junior Member
    Join Date
    Jun 2012
    Posts
    14

    Reply

    Well the only problem is that the avatar is not in the scene. It is in the library then SmartFoxServer loads it in.

  4. #4
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    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

  5. #5
    Junior Member
    Join Date
    Jun 2012
    Posts
    14
    Okay Thanks anyway. Have a good day!

  6. #6
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    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?

  7. #7
    Junior Member
    Join Date
    Jun 2012
    Posts
    14
    What do you mean by that?

  8. #8
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    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

  9. #9
    Junior Member
    Join Date
    Jun 2012
    Posts
    14
    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.

  10. #10
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    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.

  11. #11
    Junior Member
    Join Date
    Jun 2012
    Posts
    14

    Thank You So Much!

    @Basses6

    You are a complete life saver! I am so happy! Thanks!!!

  12. #12
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    no problem :P

  13. #13
    Junior Member
    Join Date
    Jun 2012
    Posts
    14

    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

  14. #14
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    Can you post your avatar chat file only the .fla maybe I can see if you messed anything up.

  15. #15
    Junior Member
    Join Date
    Jun 2012
    Posts
    14

    Link

    Okay here is the link to my Chat fla. www.mediafire.com/?mxnljs6t7rygc4c

    It also might be messed up with my config?

    Thanks

  16. #16
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    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

  17. #17
    Junior Member
    Join Date
    Jun 2012
    Posts
    14
    I have CS5.

  18. #18
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    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

  19. #19
    Junior Member
    Join Date
    Jun 2012
    Posts
    14
    Can't make a CS5 fla become a CS3 of flash 9.

  20. #20
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center