Deviant Login Shop  Join deviantART for FREE Take the Tour

Details

Closed to new replies
December 8, 2012
Link

Statistics

Replies: 2

Help with Flash "Dress Up" game (AS2 help)

:iconsherman-wip:
Sherman-WIP Featured By Owner Dec 8, 2012  Hobbyist General Artist
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?
Reply

You can no longer comment on this thread as it was closed due to no activity for a month.

Devious Comments

:iconsnowbristle:
Snowbristle Featured By Owner Dec 8, 2012
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.
Reply
:iconsherman-wip:
Sherman-WIP Featured By Owner Dec 8, 2012  Hobbyist General Artist
oh wow! I'm actually totally surprised that anyone answered me! I will try this method out! thank you so much!
Reply
Add a Comment: