Hi all, I have an existing Cairngorm based application that
I'm trying to refactor and I am a little stuck/looking for
inspiration. Originally this application was designed as a
standalone app, then it was being loaded into another Flex app with
SWFLoader. Now I am looking at doing something a little more
elegant than simply loading in a FlexApp using SWFLoader with a
bunch of hacks to expose the interface properly (since
ExternalInterface is useless even in the simplest cases, as a user
might have your site up in multiple tabs).
One of the issues is that the Cairngorm app is loaded
multiple times into the same application. With my SWFLoader hack, I
get away with it because the events don't propogate outside of the
swf instance. So my question is, how would I refactor a Cairngorm
app's events so that everything worked properly with multiple
instances? Is there an obvious/easy way to do this, or do I have to
change everything to use some sort of instance id?
Specifically, if the user clicks button A in copy X of the
cairngorm view/module/app, how do I get object J in copy X to
respond and not object J in copy Y? I assume I need some sort of
copy X instance identifier in the event or in how the event was
created...but does anyone have any quick thoughts on how to
actually do this with the least code gutting?