Sunday, July 29, 2007

Flex Pass Message to Parent Component

So I'm passing the time by getting ahead on some stuff for work (possibly dangerous at this point, I know). I have a method in a .mxml that needs to reference its parent component. The way this was accomplished before was by getting a static reference to the main app, then just doing this:

app.component.whateverINeedToDo();

Problem is, now that I'm pulling the parent component out into a module, I can't necessarily rely on a reference to the main app; I need to transfer information some other way. I could use the EventDispatcher system built into Flex. I've already extended this mildly to facilitate interaction between my modules, but it seems like overkill for a simple intra-module method call. Need to think on this.

1 comment:

Anonymous said...

Man, I just slept for 8 hours and this is enough to put me down for another.