Is that what I can pass the "Builder" parameters to the custom mxml component

I would like to create a generic dialog box (popup) using mxml and then have my subclass of dialog boxes specific to application it.  I would spend at least a parameter to the instantiation, so there the reference to its parent window.  My code looks like this so far

private static var DebugPopup:DebugViewer;

public static void creationComplete(event:Event):void {}
MainWindow = event.target as DisplayObject;
DebugPopup = new DebugViewer (MainWindow);  //only works if no parameter passed
}

-DebugViewer.mxml looks like this - some code removed for reasons of brevity-

< mx:TitleWindow >

< mx:Script > <! [CDATA]
Import mx.managers.PopUpManager;

[Bindable] public var ParentWindow:DisplayObject;

[Bindable] public var buffer: String = "Insert power ici\n;

public void log(text:Object):void {buffer += text + "\n";}   }

public void display ( parent: DisplayObject): void {}
PopUpManager.addPopUp (this, parent);
PopUpManager.centerPopUp (this);

}
[]] > < / mx:Script >
< mx:TextArea width = "400" height = "300" text = "{buffer}" / >

< / mx:TitleWindow >

I would like to set the parent window when I instantiate the dialog box, rather than go through the show method.  Is there a way to do this in a mxml component or I have to go to ActionScript.  I intend to make a general class of dialogue which is then subclssed by all of the specific dialogue of my application.

You can do this:

DebugPopup = new DebugViewer();
DebugPopup.ParentWindow = MainWindow;

Tags: Flex

Similar Questions

Maybe you are looking for