Skip to main content
Known Participant
January 12, 2013
Answered

Object with multiple positions and colors- how to keep selected position even when changing color?

  • January 12, 2013
  • 1 reply
  • 994 views

I have a  makeover game where you can change the hands position of my model and also the skin color. In a movie clip with one skin color there are all the hands possible positions. But when you click to change the color the hands position jumps to the first keyframe, it doesn't stay to the position previously selected. How can I manage this, so that whatever the selected skin color, the hands position to be the one selected and the movieclip doesn't jump to the first keyframe with the first hands position? Or is there any other way to link the skin color and the multiple hands positions but in such manner that they aren't afected by each other?

This topic has been closed for replies.
Correct answer Ned Murphy

I think I might understand what you have done and what the problem is.  WHenever you change the hands movieclip to be another color, you need to change the hands.hands movieclip to be at the same frame as it was for the other color.  So you need to keep track of which hands.hands position frame you are in and assign that anythime you change the color...

     _root.doll.hands.gotoAndStop(1); // 2,3,etc

     _root.doll.hands.hands.gotoAndStop(positionFrame);

Other approaches for this.

If you are using flat colors for the hands, one way would be to just use code to recolor the hands instead of using movieclips/frames  That way you don't have to change the hands movieclip for the different colors, which means you only need one movieclip for the positions... you essentially just recolor the hands in that one positions mc.

Another approach would be to have all of your hand color mc's in the same frame and control their visibility.  Anytime you change the position of a hand, you change them all.  When you change the color, you first make all of the color mc's invisible, followed immediately by making the selected color mc visible.

1 reply

Ned Murphy
Legend
January 12, 2013

Can you explain how you have designed this functionality and show the code relevant to the problem.

zosajiAuthor
Known Participant
January 13, 2013

I have  a movie clip named doll,  in this movie clip I have on a frame     - the bodies that its a movie clip named doll,in this movie clip are all the colors of the bodies                                                                                                              

                                                                                                        - on a second frame above the bodies is a movie clip named hands, in this movie clip are the colors of the hands with the initial position, each color its a movie clip named again hands, in witch I have the color ,example.... if I have the color black...the hands black are all in the same movie clip that its named hands, if I have the color white... the hands white are in the same movie clip that    its named again hands.  the hands are in the same frame line,but on different frames(1,2,3...), thats the same with the body. 

the buttons for the body skin to change an preserve also the color of the hands have this code:  on (release)

                                                                                                                                          {      _root.doll.doll.gotoAndStop(1);    

                                                                                                                                                 _root.doll.hands.gotoAndStop(1);  } 

It's gotoAndStop..1,2,3...depends on the color you choose. for the hands I have the buttons that changes the position and the skin colors of the hands: 

                                                                                                                                      on (release) {     

                                                                                                                                     _root.doll.hands.hands.gotoAndStop(1);

                                                                                                                                     }

The problem is that I managed to change the skin and hands color to be the same...but when I change the position of the hand,and after maybe I want another color, the color is changing but like i said the position of the hands turns to the first position.

Thank you for your help, and hope you have understand what I have said cause I'm not very good at explanation.

Ned Murphy
Ned MurphyCorrect answer
Legend
January 13, 2013

I think I might understand what you have done and what the problem is.  WHenever you change the hands movieclip to be another color, you need to change the hands.hands movieclip to be at the same frame as it was for the other color.  So you need to keep track of which hands.hands position frame you are in and assign that anythime you change the color...

     _root.doll.hands.gotoAndStop(1); // 2,3,etc

     _root.doll.hands.hands.gotoAndStop(positionFrame);

Other approaches for this.

If you are using flat colors for the hands, one way would be to just use code to recolor the hands instead of using movieclips/frames  That way you don't have to change the hands movieclip for the different colors, which means you only need one movieclip for the positions... you essentially just recolor the hands in that one positions mc.

Another approach would be to have all of your hand color mc's in the same frame and control their visibility.  Anytime you change the position of a hand, you change them all.  When you change the color, you first make all of the color mc's invisible, followed immediately by making the selected color mc visible.