I’m trying to create a oop flash website, but I’m really struggling with some basic things.
Example 1:
We’ve got four classes
DocumentClass -> FormsClass -> Form1Class -> ListClass
Let’s say someone clicks a next button in the FormClass. That dispatches an event “nextForm”. Documentclass is listening for this event, and displays the next page. But it needs to read a value (selected radiobutton) from the ListClass. What would be the best way to get this variable to the documentclass?
a. newvar = mcForms.mcForm1.mcList.getSelected();
b. newvar = mcForms.getSelected, which callls, mcForm1.getSelected, which callls mcList.getSelected();
c. create a custom event that transports the variable with it.
Somehow this all seems wrong.
Example 2:
I’m trying to build a standard error displaying class. Is there a way that it can listen to dispatched error events without knowing which class they come from? The way I do it now is like this:
mcForms.mcForm1.addEventListener(“error”, ShowError,false,0,true);
But I have to do this for every single class. It just seems too complicated.