Help with Flash "Dress Up" game (AS2 help)
Hey I'm trying to make a "dress up" game to improve on make Action Script comprehension...
SO here's my problem:
I'm trying to have the hair of the character being change with arrows AND have the user be able to select a different hair color from various color buttons.
At the moment I'm using the script below to change the hair styles(the styles are all in a movie symbol with the instance name hairM) and this works great:
on (press) {
_root.hairM.nextFrame();
}
With in the style movie symbol I have symbols for each of the hair style and within those are the various colors.
I thought I could use a similar code just changing the instance name to that of the hair style within the "hairM" symbol...
but that didn't work...
Does anyone have any ideas?
SO here's my problem:
I'm trying to have the hair of the character being change with arrows AND have the user be able to select a different hair color from various color buttons.
At the moment I'm using the script below to change the hair styles(the styles are all in a movie symbol with the instance name hairM) and this works great:
on (press) {
_root.hairM.nextFrame();
}
With in the style movie symbol I have symbols for each of the hair style and within those are the various colors.
I thought I could use a similar code just changing the instance name to that of the hair style within the "hairM" symbol...
but that didn't work...
Does anyone have any ideas?
Comments3
Join the community to add your comment. Already a deviant? Log In
I do things like that but with a different method. On the scene I will put some code like this
onFrame (1) {
stop();
_root.hair01._visible = true;
_root.hair02._visible = false;
_root.button01._visible = true;
_root.button02._visible = false;
}
Then I make arrows that function as buttons
on (release) {
_root.hair01._visible = false;
_root.hair02._visible = true;
//make arrow button 1 invisible and arrow button 2 visible
_root.button01._visible = false;
_root.button02._visible = true;
}
If you follow this method of true and false commands you can use them to make all sort of buttons and menus. Just change the true and false statements in the different arrow buttons.
The coloring part for the hair is easy. Have a button that is the color you want the hair to be
on (release) {
haircolor = new Color("_root.hair01");
haircolor.setRGB(0x9933FF);
}
Change the hex code for the hair color you want. Make multiple buttons each with a different hex code.
hair01 is the hair item. Try to keep this as a vector shape as vector shapes tend to be easier to color and work better for this than bitmaps. Make sure you have a backup of your old files before you save any changes.
onFrame (1) {
stop();
_root.hair01._visible = true;
_root.hair02._visible = false;
_root.button01._visible = true;
_root.button02._visible = false;
}
Then I make arrows that function as buttons
on (release) {
_root.hair01._visible = false;
_root.hair02._visible = true;
//make arrow button 1 invisible and arrow button 2 visible
_root.button01._visible = false;
_root.button02._visible = true;
}
If you follow this method of true and false commands you can use them to make all sort of buttons and menus. Just change the true and false statements in the different arrow buttons.
The coloring part for the hair is easy. Have a button that is the color you want the hair to be
on (release) {
haircolor = new Color("_root.hair01");
haircolor.setRGB(0x9933FF);
}
Change the hex code for the hair color you want. Make multiple buttons each with a different hex code.
hair01 is the hair item. Try to keep this as a vector shape as vector shapes tend to be easier to color and work better for this than bitmaps. Make sure you have a backup of your old files before you save any changes.
oh wow! I'm actually totally surprised that anyone answered me! I will try this method out! thank you so much!