mx:HTML control won't display when added in code-behind
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:
var tmpHtml:HTML = new HTML();
tmpHtml.htmlText = "<开发者_StackOverflow社区;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);
You need to add tmpHtml to application, not stage.
精彩评论