I have a MainClass and a GUIClass. The MainClass lets the GUIClass handle everything about the GUI. How do I call different Object properties from the MainClass to the GUIClass.
package {
import gui;
public class main {
public var ui:Object = userInterface_mc as Object;
public var myGui:gui = new gui;
function main() {
myGui.prepareObject(ui);
myGui.tf01 = "foo";
}
}
package {
public class gui {
private var ui:Object;
private var textField01:TextField = textField_01 as Textfield;
function prepareObject (myUI:Object) {
ui = myUI;
}
function set tf01 (myString:String) {
textField01.text = myString;
}
}
}
The code shows how I pass the text property of a TextField. But now I have a ComboBox and I need to fill in data, clear it, receive the label and data. Is there any way to call it like
myData = GUI.comboBox01.data;
myLabel = GUI.comboBox01.label;
GUI.comboBox01.resetAll();
GUI.comboBox01.addItem({label:"foo", data:"baa"});
Best regards
TD