PDA

View Full Version : A pretty simple problem, I'm sure, but I need help



ozzy_fan666
October 21st, 2004, 10:01 PM
I need to be able to display three different people, name one and play as that character throughout the game, displaying the name you chose. I have only been using actionscript in and out for about a year, using flash mainly for drawing. Could someone out there help me?

SmurfMX
October 22nd, 2004, 03:11 AM
It'd be best to store them in an array like so.


var chars:Array = new Array();
chars[0] = {name:"Amy", linkage:"amyAvatar"};
chars[1] = {name:"Sammie", linkage:"samAvatar"};

What's going on here?
Well instead of creating an array made up of seperate arrays for each character (**** that'd be messy!) I'm putting in an obj hence the {}. The name would be the character name and the linkage would be the linkage name of the MC within the library. When the user changes a character you could call a custom function, for example we'll call it changeChar, changeChar that reattaches the MC based on what button or whatever is clicked.