Interfaces, and events.  Dialogs should implement an interface of
properties and methods and dispatch events when things change

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of edlueze
Sent: Wednesday, July 16, 2008 9:15 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] PopUpManager to Set General-Purpose Control

 

Hi Folks:

I am using PopUpManager to create a set of general-purpose pop-up
dialog boxes that can be used throughout my application. For example,
I have a TextBoxDialogBox that will ask the user for text input and
then place that input into a TextInput control in the caller window.
Similarly I have a CheckBoxDialogBox that asks for yes/no input and
then places that input into CheckBox control in the caller window.

I'm finding that I'm writing the same code over-and-over to handle
each variation. For example, I need to declare and set different
variables depending on the type of pop-up, as such:

var popupTextBoxReturnControl:TextInput;
var popupCheckBoxReturnControl:CheckBox;

And then I have a set of very similar functions that will set the
return value. For example:

popupTextBoxCallerReturn.text = popupTextBoxReturnControl.text //OR
popupCheckBoxCallerReturn.selected = popupCheckBoxReturnControl.selected

I want to be able to condense the code down so that a variable for
just one control is needed - perhaps using IFlexDisplayObject. But
when I try to do this I get the error "1119: Access of possibly
undefined property text through a reference with static type
mx.core:IFlexDisplayObject."

Does anybody have any suggestions on how I can condense a dozen
virtually identical functions down into a couple more general purpose
functions?

Thanks in advance!

 

Reply via email to