Scaling onstage MovieClip w/ “scaleX” breaks timeline animation …really?

丶灬走出姿态 提交于 2019-12-23 04:45:16

问题


I'm scaling onstage MovieClips via AS properties "scaleX" or "scaleY", which kills any kind of animation the clips have within their container MovieClip, be it Classic or Motion Tweens. When I don't scale the MovieClips, they animate fine. I'm able to tell the clips to "gotoAndStop" on their own internal frames, and that doesn't affect their animation within their container clip. I'm referencing the clips via AS w/ their instance names defined in the IDE. I've also tried different clips and recreated them, getting the same behavior.

Is it possible to scale a clip via AS and still have it animate within its container timeline?

Does applying an AS property to an onstage instance somehow dissassociate it from other timeline properties?


回答1:


As far as I am aware you can't stop that side effect occuring. The Flash manual (flash.display.MovieClip) states:

"If you modify any of the following properties of a MovieClip object that contains a motion tween, Flash Player stops the playhead in that MovieClip object: alpha, blendMode, filters, height, opaqueBackground, rotation, scaleX, scaleY, scale9Grid, scrollRect, transform, visible, width, x, or y. However, it does not stop the playhead in any child MovieClip objects of that MovieClip object."

You can however "Copy" the motion tween to ActionScript 3.0. This will generate an XML Description of the tween and code for constructing a new Animator (fl.motion.Animator). This can be pasted whereever you please (it is on your clipboard). Now you can either; manually add a new Keyframe (fl.motion.Keyframe) node to the document, or programmatically generate it.

I hope this helps.



来源:https://stackoverflow.com/questions/1669763/scaling-onstage-movieclip-w-scalex-breaks-timeline-animation-really

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