Simple concept, but I must be missing something.
HERE’S THE SETUP:
**1) **I create 2 empty MCs:
var container = s1HLD.createEmptyMovieClip(“HLD1”,2);
var container = s1HLD.createEmptyMovieClip(“HLD0”,1);
**2) **then I use code from: http://www.kaourantin.net/2005/12/dynamically-loading-bitmaps-with.html
for bitmap smoothing b/c Flash 8 developers where payed more than they deserved :sigh: :
[AS]
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);
}
[/AS]
**3) **Lastly, I have a simple function that loads the image into the container MC.
[AS]
function firstImage() {
loadBitmapSmoothed(_root.middle[0],container);
}
[/AS]
HERE’S THE PROBLEM:
The function works well if, instead of my target MC being the var “container”, it’s “s1HLD.HLD0.” However (of course), I need to use the var “container” b/c container is truly sometimes s1HLD.HLD[COLOR=Red]0[/COLOR], but other times it’s s1HLD.HLD[COLOR=Red]1[COLOR=Black] (depending on another var). It should work EITHER WAY!!! Right???
I know this can’t be all that difficult, but I haven’t been able to find a workaround.
Any help would be appreciated.[/COLOR][/COLOR]