Tuesday, April 1, 2008

Flash SWF contolling Flex SWF

I just got my serial number for Flex Builder 3 Educational Edition, cheers~

The first problem I encounter is, I have no idea how I can loader a Flex SWF into a Flash SWF through Loader and control it within the Flash SWF.

I ended up looking for answers on Google, and I found this: REFERENCE

Great, now I know every Flex SWF has two frames.
And the Flash SWF's root counterpart in Flex's SWF is application

So here's the general procedure:

1. Load a Flex SWF through a Loader object.
2. Use any utility to delay the code that accesses anything in the Flex SWF (like Timer or Tweener).
3. If there's a button called btn on the top level in the Flex SWF, I could reference it by typing loader.content.application.btn


Thanks a lot, Wim Vanhenden~

No comments: