# How to embed flex swf into flash

**URL:** <https://forum.kirupa.com/t/how-to-embed-flex-swf-into-flash/291287>\
**Category:** Uncategorized\
**Created:** [June 27, 2009, 9:58am UTC](https://forum.kirupa.com/t/how-to-embed-flex-swf-into-flash/291287 "2009-06-27T09:58:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![remat\_narab](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@remat\_narab](https://forum.kirupa.com/u/remat_narab)\
**Post date:** [June 27, 2009, 9:58am UTC](https://forum.kirupa.com/t/how-to-embed-flex-swf-into-flash/291287/1 "2009-06-27T09:58:14Z")

</div>

Hello,

I have written an xmpp chat client in flex. It works fine. My goal is to embed the swf file into flash CS4. But when i do that with Loader class in AS3 , some of my buttons in my flex swf throws null pointer exception. The code i used to embed the flex swf into flash is below

```auto
var loader = new Loader();
loader.load(new URLRequest("flex.swf"));
stage.addChild(loader); 

```
