Search code examples
actionscript-3apache-flexadobemxml

How do I set this in actionscript instead of mxml


I'm working with some mxml that I'd like to see how it looks like in actionscript. It's a popupAnchor that just has a custom view called HTMLWindow. The custom view is basically nothing but an mx HTML component <mx:HTML>

<s:PopUpAnchor>
   <views:HTMLWindow id="htmlWindow" width="500" height="500" />
</s:PopUpAnchor>
----
<mx:HTML id="html" width="100%" height="100%" />

So I basically know how to make <mx:HTML> and <s:PopUpAnchor> in actionscript and not sure how to display the <mx:HTML> inside the <s:PopUpAnchor>.

var html:HTML = new HTML();
var popup:PopUpAnchor = new PopUpAnchor();
//how do I tell the popup to display the HTML object

Solution

  • PopUpAnchor descends from DisplayObjectContainer, so...

    popup.addChild(html);