I've made a new component called "PopUpBox" that is the Canvas component to be overlayed. In my main application, on the button click I'm adding "PopUpBox" to my main application container. This all works. The PopUpBox is added, but is added after my other content, not above it.
I'm assuming I have to add a script tag to my PopUpBox component that will set the index of the component. This is what I'm trying and it doesn't work:
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="450" height="650" backgroundColor="#eeeeee">
<mx:Script>
<![CDATA[
private function init():void {
parent.setChildIndex(this.parent, 0);
}
]]>
</mx:Script>
</mx:Canvas>