How to maintain a movieclip's color between frames?

后端 未结 2 1677
情歌与酒
情歌与酒 2021-01-27 10:26

My app has 2 frames; in frame 1 there are 5 MC and on a DOUBLE_CLICK event the target\'s color change and go to the next frame 2.
In frame 2 I have a button to

相关标签:
2条回答
  • 2021-01-27 11:02

    The simplest way would be to have three frames, create your MCs on frame 1 and switch between frame 2 and 3.

    You could also store the color information in an object.

    _color[e.target.id] = newColorTransform.color;
    

    And then retrieve it and apply it. But there again you will need to have the initialization of your data object on a previous, third frame. If you don't it will be reinitialized and you will lose your colors.

    0 讨论(0)
  • 2021-01-27 11:15

    If you make a class for the movieclips (you have 5 I believe) that they all share. Create a class property called myColor, then update each individual movieclip object's "myColor" property whenever it is double-clicked and the color changes, you can make the "goBack()" method re-apply each movieclip's color from its own property.

    Does this make sense?

    0 讨论(0)
提交回复
热议问题