# Importing Bitmaps from an SWF exported via Flash CS3

**URL:** https://forum.kirupa.com/t/importing-bitmaps-from-an-swf-exported-via-flash-cs3/280606
**Category:** flash
**Created:** [January 29, 2009, 12:02pm UTC](https://forum.kirupa.com/t/importing-bitmaps-from-an-swf-exported-via-flash-cs3/280606 "2009-01-29T12:02:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![megadev](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@megadev](https://forum.kirupa.com/u/megadev)
#### Post date: [January 29, 2009, 12:02pm UTC](https://forum.kirupa.com/t/importing-bitmaps-from-an-swf-exported-via-flash-cs3/280606/1 "2009-01-29T12:02:19Z")

</div>

Hi everyone,

I’m currently integrating one of my games with the SDK of a certain publisher (who shall remain nameless), but I’m having real problems. They require all games to load their content (ie. images, sounds etc) from an external SWF, like so:

```auto

private var __gameScreen:MovieClip;

private function onContentSwfLoaded(result:MediaLoaderResult):void
{
    // Store our content and add it to the stage
    var contentSWF:MovieClip = result.content as MovieClip;

    assert(contentSWF != null, "content swf is null");

    // Create a reference to the game screen movieclip in the content SWF                   
    __gameScreen = contentSWF.stateGame;

    // Set up the game timeline
    addChild(__gameScreen);
}

```

The problem here is that I really don’t want to have to use MovieClips as all of my games use nothing but BitmapData, so I’m wondering if there’s a way of extracting a Bitmap or BitmapData from an SWF? It doesn’t appear that Flash CS3 caters for this though - you can assign an “instance name” to a MovieClip, but not a Bitmap as far as I can tell. I usually develop in Flex Builder 3 but I’ve not managed to extract anything from an SWF exported from it, probably because you can’t assign instance names to objects, I’m guessing. My current work-around for this problem is to draw each MovieClip to a BitmapData object, but this is very long-winded and probably not too efficient either. Anyway, enough of my ramblings - if anyone could give me some idea of where I’m going wrong (assuming I’m going wrong), I’ll buy you a pint or three! 🙂

Cheers,

Mike.
