Forums → Programming Forum → Variable Help Needed
0 | 2808 |
- 0 Replies
Showing 1-0 of 0
0 | 2808 |
This is in AS2!
Well, yet again, I need help in Flash (big surprise). I'm making an RPG game and for the customization system, I figured it would be best to associate each choice with a variable then use that variable to define how the character looks in the next scene. As an example, I'll use hair color.
Scene 1, Frame 1:
_global.haircolor = 0;
Scene 1, Frame 1, Customizatiomenu_mc, Frame 4:
stop();
bluehairbutton.onRelease = bluehairfunction;
redhairbutton.onRelease = redhairfunction;
function bluehairfunction() {
haircolor = 1;
}
function redhairfunction() {
haircolor = 2;
}
Scene 2, Frame 1:
if (haircolor == 1){
character.head.gotoAndStop(1);
}
if (haircolor == 2){
character.head.gotoAndStop(2);
}
Any ideas anyone?
Also, if there's a better way of doing this character customization thing, please let me know!
Thanks in advance to anyone who can help!