# Preloader and Flash bitmap smoothing work around

**URL:** https://forum.kirupa.com/t/preloader-and-flash-bitmap-smoothing-work-around/212536
**Category:** flash
**Created:** [January 11, 2007, 8:48pm UTC](https://forum.kirupa.com/t/preloader-and-flash-bitmap-smoothing-work-around/212536 "2007-01-11T20:48:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jimjiminyjimjim](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jimjiminyjimjim](https://forum.kirupa.com/u/jimjiminyjimjim)
#### Post date: [January 11, 2007, 8:48pm UTC](https://forum.kirupa.com/t/preloader-and-flash-bitmap-smoothing-work-around/212536/1 "2007-01-11T20:48:35Z")

</div>

I was just loading a bitmap dynamically into a loader component and then linking that to a progress loader bar componetn.

However, I’ve now switched to using this bitmap smoothing workaround for dynamic images

```auto

stop();

import flash.display.*;

function loadBitmapSmoothed(url:String, target:MovieClip) {
    // Create a movie clip which will contain our 
    // unsmoothed bitmap
    var bmc:MovieClip = target.createEmptyMovieClip(
        "bmc",
        target.getNextHighestDepth());

    // Create a listener which will notify us when 
    // the bitmap loaded successfully
    var listener:Object = new Object();

    // Track the target
    listener.tmc = target;
 
    // If the bitmap loaded successfully we redraw the 
    // movie into a BitmapData object and then attach 
    // that BitmapData to the target movie clip with 
    // the smoothing flag turned on.
    listener.onLoadInit = function(mc:MovieClip) {
        mc._visible = false;

        var bitmap:BitmapData = new BitmapData(
            mc._width, 
            mc._height, 
            true);

         this.tmc.attachBitmap(
            bitmap, 
            this.tmc.getNextHighestDepth(),
            "auto", 
            true);

         bitmap.draw(mc);
    };
 
    // Do it, load the bitmap now
    var loader:MovieClipLoader = new MovieClipLoader();
    loader.addListener(listener);
    loader.loadClip(url, bmc);
}

loadBitmapSmoothed(picture,this.myLoader);

```

My progress bar has stopped working. Whats the best way to get a progress bar working with this?
