开发者

Text of the dynamic textField stretches when movieclip is resized?

Well, i have a movieclip containing a dynamic text-field in it. When movieclip is stretched using transform manager, the text stretches. i am developing a component. Moreover,Event.Resize can not be used as Event.Resize is the Stage event. it does not work for movie-clips and sprite. Putt开发者_如何转开发ing it in Event. Enter Frame works but that hangs the whole CMS when this technique is used. Any helps??


If you are using Greensocks transform manager, there are already custom events built in that you can use like this:

manager.addEventListener(TransformEvent.SCALE, onScale);

in the onScale Function you can set the scale of the TextField as you like, for example keep its original scale:

tf.scaleX = 1 / yourMovieClip.scaleX;
tf.scaleY = 1 / yourMovieClip.scaleY;

or simply maintain a correct aspect ratio:

tf.scaleY = tf.scaleX * yourMovieClip.scaleX / yourMovieClip.scaleY;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜