I use this code to create and show a MessageWindow:
var newTitleWindow:MessageWindow = PopUpManager.createPopUp(contextView,MessageWindow, true) as MessageWindow;
newTitleWindow.text = message;
PopUpManager.centerPopUp(newTitleWindow);
MessageWindow source code:
<?xml version="1.0"?>
<s:TitleWindow title="Something gone wrong" width="200" height="130" xmlns:mx="http://www.adobe.com/2006/mxml"
close="closeMe()" resize="centerMe()" xmlns:s="library://ns.adobe.com/flex/spark" >
<mx:Script><![CDATA[
import mx.managers.PopUpManager;
[Bindable]
public var text:String;
private function closeMe():void {
PopUpManager.removePopUp(this);
}
private function centerMe():void {
PopUpManager.centerPopUp(this);
}
]]></mx:Script>
<s:VGroup top="0" bottom="0" left="0" right="0">
<s:Label id="lbl" left="10" right="10" textAlign="center" text="{text}"/>
<s:Button id="btn"/>
</s:VGroup>
</s:TitleWindow>
There is no nested components displayed when I run my app.
The debugger shows they are created and visible.
To my “amusement” the components are shown when I replace s:TitleWindow with mx:TitleWindow.

I really want to use spark TitleWindow.
Is there any trick to fix this behavior?
Try replacing
mx:Scriptwithfx:Script