Load Flex Into Flash
This question comes up a lot, mostly from the standpoint of creating lightweight app. managers in Flash CS3 that load independent portions of an application that are written in Flex. I’ve used this in the past for PureMVC applications that load other PureMVC apps, for example. The technique in the sample files is a quick hack, but hacks can be fun. No time for a full-on tutorial, so you’ll have to deconstruct it yourself. Pretty easy to figure out and you will probably be able to find the cleaner way to accomplish the task as well 🙂
The Flex -> Flash example shows how to create a simple Flex app. with a button that dispatches an event on click. The Flash CS3 Document class loads the .swf created by Flex and assigns a handler for the event. The handler manipulates the button and calls a public method defined in the Flex app’s SCRIPT block.
The same method can be used to load Flex into Flex and there are examples of both. The Flex -> Flex example shows a couple variations that may be of interest to you.
There is a README file with the code distribution. Download the files here and have fun!