This content has been marked as final. Show 5 replies
Wouldn't be easier to declare some public variables in the component mxml ?
// in the component mxml
public var something:type;
// in the main application mxml
var browserPop:CustomBrowser = new CustomBrowser();
Sorry maybe i didint explain what im doing very well.
Yes my component does have public variables, they are called targetType and fileType as can be seen from my example. In the main application i want to create a popup with my custom component called CustomBrowser but i want to be able to set the variables. Would it maybe be possible to override the constructor of the TitleWindow and pass in the variables inside the createPopUp method?
Ok i guess what im trying to do is pass parameters to an object being used in the createPopUp method, ive seen that flex 1.5 had an initObj parameter in createPopUp for this but has been removed in 2.0+.
Create you component using the popupmanager, then cast it to the
specific type to access it's public methods and/or variables.
Like so for mxml component ExceptionPopup:
popup = PopUpManager.createPopUp(_parentPanel,ExceptionPopUp,true,null);
(popup as ExceptionPopUp).addRecords(ev.errorMessage);
(popup as ExceptionPopUp).title = "title";
(popup as ExceptionPopUp).userText.text = "some user text"
Thanks JK, i really wish i could set the parameters before creating the popup but this works as well.