如何使用 as3 在影片剪辑中动态创建文本?

发布于 2024-07-15 01:59:52 字数 68 浏览 4 评论 0原文

我想创建像彗星一样的动画文本。 我想创建重力效果,在矢量上加速影片剪辑,在舞台上设置起始位置并从 xml 文件加载文本。

I would like to create text animated like a comet. I would like to create a gravity effect, accelerate the movie clip on vector, set a starting position on stage and load the text from a xml file.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

飘过的浮云 2024-07-22 01:59:52

如何在 a 中创建动态文本
使用as3 进行影片剪辑?

您可以像任何其他 DisplayObject 一样创建一个 TextField 并将其添加到所需的父级中。

例如,

var myText:TextField = new TextField();
myClip.addChild(myText);
myText.text = 'Hello!';

我认为我不完全理解你的问题。 据我了解,你应该:

  1. 加载 xml,这样你就可以得到
    事先发短信(你不需要
    等待 xml 加载
    你正在播放动画
  2. 添加你的剪辑和文本字段
  3. 动画

如果你正在为文本添加动画,需要注意一件事:当你嵌入字体时,动态文本看起来动画效果更好,如果你计划为旋转或阿尔法设置动画,你将需要嵌入字体,否则您将无法为这些属性设置动画。

祝你好运!

How do I create dynamically text in a
movie clip using as3?

you create a TextField like any other DisplayObject and add it to the parent you want.

e.g.

var myText:TextField = new TextField();
myClip.addChild(myText);
myText.text = 'Hello!';

I don't think I fully understand your question. From what I understand you should:

  1. load the xml so you would have the
    text beforehand( you wouldn't need
    to wait for the xml to load while
    you're playing the animation
  2. add your clips and textield
  3. animate

One thing to be aware if you're animating text: dynamic text looks better animated when you've got the font embedded, also if you plan to animate rotation or alpha you will need to embed fonts, otherwise you won't be able to animate those properties.

Good luck!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文