I'm unable to cast the event to the exact class that was sent.
Event class really doesn't have a place to store custom data object for sub app to extract.
We have no control over legacy SWFs that main app will load. Similar to portlets?
<!-- automatic load if in mxml -->
var dynamicEvent: DynamicEvent = new DynamicEvent( LoadCaptureEvent.LOAD_CAPTURE_TYPE );
dynamicEvent.capture = new CaptureModel();
testApp.swfBridge.dispatchEvent( dynamicEvent );
public function applicationComplete() : void
trace( "applicationComplete" );
var manager:ISystemManager = this.systemManager;
public function captureEventHandler( event: Event ) : void
trace( "captureEventHandler" );
What I've done to try to solve it:
Test case where Events are successfully reaching the sub application.
Flex Builder debugger shows the correct class of event was in handler
I understand that the sent Event listeners are not strongly typed.
I've read the Marshall Plan.
I looked at Alex's powerpoint presentation.
I've tried the SWFBridgeEvent with same casting problem.
If you look closely at the SDK source, you'll see the marshal() method on
events that go across the boundary. Each SWF has its own definition of
DynamicEvent and they are not compatible.
Looks like a copy constructor that uses your class definition in your application domain.
The copy constructor for events seems to luck out because very few properties and simple primitive types.
We have a very complex value object passed over.
Can we use serialization in main app with writeObject and readObject on the other end?
Ran into registerClassAlias() in research.
Bootstraping won't work because docs say
"Adding complex value object classes to the bootstrap loader is not supported." ?