I have a Flex 2 app with an embedded SWF file that I'm loading into Flex with mx:SWFLoader. The swf file is a fairly complex form written in Flash 8 / AS 2.0 that uses xml web services to pull data into a form which is edited and then re-submitted.
Once a user is finished with the embedded swf form, (s)he clicks a button which saves all the form data via another web service call, then I *want* to pass control back to the Flex app with an event or trigger that I can recognize to continue the data entry process. How can I get the embedded swf form to trigger an event and/or function in the parent Flex 2 application? I also need to pass a variable back to the Flex app. So, in a nutshell, when a user clicks the "submit" button of the embedded swf form, I need it to save the form data then pass a variable (e.g. "CartID") back to the Flex app and let Flex handle the process from there. Any thoughts on how to accomplish this? NOTE: I've set trustContent=true in the mx:SWFLoader, but I can't seem to find any decent documentation on how to access the parent Flex app functions/events or pass data back and forth, etc.