mx:在代码隐藏中添加HTML控件时不会显示

时间:2023-02-10 21:08:12

I am building an AIR application and I was planning to include the mx:HTML control but I can't seem to get the control to display. Here is the code:

我正在构建一个AIR应用程序,我计划包含mx:HTML控件,但我似乎无法显示控件。这是代码:

var tmpHtml:HTML = new HTML();
tmpHtml.htmlText = "<a>This is the sample </a>";
tmpHtml.x = 48;
tmpHtml.y = 10;
tmpHtml.width = 360;
tmpHtml.height = 169;
tmpHtml.visible = true;
stage.addChild(tmpHtml);
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.addChild(txt);

1 个解决方案

#1


1  

You need to add tmpHtml to application, not stage.

您需要将tmpHtml添加到应用程序,而不是阶段。

#1


1  

You need to add tmpHtml to application, not stage.

您需要将tmpHtml添加到应用程序,而不是阶段。