<p>How can I raise an event from a SWF file loaded into a Flex application (using SWFLoader)?</p>

<p>I want to be able to detect</p>

<pre><code>a) when a button is pressed
b) when the animation ends
</code></pre>

You'll need to do 2 things:
Dispatch an event from the loaded swf. Make sure the event bubbles if you sent it from nested views. Bubbling can be set through the bubbles property of the event.
Listen to the event from your main application. I think you should be able to do that on the content property of the SWFLoader instance.
```
```
mySWFLoader.content.addEventListener("myEvent", myEventHandler);
```
```