在影片剪辑图像上添加文本字段

adding textfield over movieclip images

我有几张图片,它们是带有 Alpha 参数的 Symbols (movieClip)。 我正在从 AS3 创建动态文本字段,以便能够每隔几秒更改一次文本。

问题是在我将图像转换为 MovieClip 之前一切正常。但在那之后我的文本字段不可见。

代码如下:

textFormat = new TextFormat();
textfield = new TextField();

textFormat.font = new customFonts().fontName;
textFormat.size = 16;
textFormat.align = "center";
textFormat.color = 0xFFFFFF;

textfield.defaultTextFormat = textFormat;
textfield.embedFonts = true;
textfield.width = 480;
textfield.height = 95;
textfield.x = 185;
textfield.y = 22;
textfield.wordWrap = true;


addChild (textfield); 

所以问题是 - 如何将此文本字段置于顶部以使其可见?

您将在影片剪辑启动后添加您的文本字段。把它想象成一个层,文本字段在底层,因此它们不会被看到。

我会看看容器class

The Container class is an abstract base class for components that controls the layout characteristics of child components. You do not create an instance of Container in an application. Instead, you create an instance of one of Container's subclasses, such as Canvas or HBox.

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/core/Container.html

您应该可以更改显示的内容。

编辑:

Anytime you add a clip it is added on top by default.

您还应该查看 Z-Index。

如果您使用 Flash Develop 进行编码,那么它可能会变得棘手,而使用 Flash Adob​​e CC 可以让您的生活变得更加轻松!

抱歉,如果答案不是那么多。