View Full Version : Avatar Creation System [AS2 Request]
Namikaze
July 3rd, 2009, 07:37 PM
So, I'm attempting to code online games, a big thing people seem to look for in these type of things is the option to make a little avatar. How would I go about creating an Avatar Creation System... What I'm looking for is something like this.
[<]:megaman_x:[>]
And you press the arrow and it changes, then shows the 'avatar' they created in the next scene.
Help or an .fla would be nice. Also, I'm using Flash 8, so please if you give an .fla make it so I can use it...
bluemagica
July 3rd, 2009, 07:51 PM
No, we do not give files unless you show some willingness to learn by yourself first! Also, whats your actionscript experience?
To make a avatar system, all you need is knowledge of buttons, and gotoAndStop commands! In your given....umm.....sample scenario, assume the smiley is a movieclip called "head_mc", inside the movieClip, put different images in different frames.
On the timeline create a variable, say "var_head = 0;" , then when a button is pressed just increase or decrease it's value by one, and say something like "head_mc.gotoAndStop(var_head);"! That's it for the basics!
Namikaze
July 3rd, 2009, 07:54 PM
Ehe, About the willingness to learn part, I said help OR an .fla, really I was just saying I would accept either one. I have been working with AS2 for several years, I don't feel comfortable with AS3 quite yet.
About the.. erm sample, I just used what I saw around me, ehe.
bluemagica
July 3rd, 2009, 08:04 PM
err, you said you are using flash8, so you are pretty much restricted to as2, right? and if you have a few years experience of as2, then i guess you can now pull off the avatar system!
Anyway, by willingness to learn, I meant instead of just going and asking for help on something, show what you have tried first! We know, most the time what you might try might be by a mile off, but it helps us too see what exactly you were trying to do, and where you made the mistakes!
Namikaze
July 3rd, 2009, 08:11 PM
err, you said you are using flash8, so you are pretty much restricted to as2, right? and if you have a few years experience of as2, then i guess you can now pull off the avatar system!
Anyway, by willingness to learn, I meant instead of just going and asking for help on something, show what you have tried first! We know, most the time what you might try might be by a mile off, but it helps us too see what exactly you were trying to do, and where you made the mistakes!
Ah I see now. However at the time I had overcomplicated the whole process in my head.
I'll be posting what I have accomplished thus far in a little bit...
blanked
July 4th, 2009, 05:48 PM
This should be pretty easy imo if you've been programming for a long time... I'm new and only learning AS3, so I won't upload the code.
This is what you are looking for, right? (Click the STAGE to change frames, not the character).
http://www.swfcabin.com/open/1246739024
It does not support going back and all that (only 2 images right now) but it's the basic. Too lazy to make buttons =)
I implemented bluemagica's idea.
stage.addEventListener(MouseEvent.CLICK, changeChar);//adding event listener- you don't have to do this in as2
var head:Number = 1;//variable to keep track of frames
function changeChar (evt:MouseEvent):void {//my function
head++;//adding to head variable
head_mc.gotoAndStop(head);//head_mc has frames with the char. So when I click the button (or stage), the variable head increases, thus making it play to 2 in this example (default of the head variable was 1)
}
Read the comments
Jephz
July 4th, 2009, 10:29 PM
Hes using AS2.
And for starters Namikaze, having a few years experience in AS2 you should be extremely familiar with the "gotoAndStop" function.
flyingmonkey456
July 5th, 2009, 05:56 PM
this seems simple, just do it slot machine style. have them all arranged in a row with a little window that you can see the selected one through. even better, you could do a carousel thing where they're on the sides of a cylinder that rotates when you press the buttons. the choice is yours, but you'll need to have a number for each avatar and set a variable to that number that corresponds to the selected avatar. just put that number with the save game data and you're done :)
bluemagica
July 5th, 2009, 06:01 PM
-_- you are scary!
flyingmonkey456
July 5th, 2009, 07:31 PM
about the carousel thing, you would need to have their width relative to their distance from the center of the carousel. just make them get thinner as they get farther out :)
also you would need to make them move slower as they get father from the center. oh, and when they get to one side of the carousel make sure you move them to the other side. if you have too many of them to fit on the visible half of the carousel, keep moving them away from it, but set their alpha to 0 when they pass the edge.
-_- you are scary!
me?
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.