How to maintain a movieclip's color between frames?

▼魔方 西西 提交于 2019-12-02 11:12:29

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.

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?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!