Skip to content

Instantly share code, notes, and snippets.

@cappuccino
Created March 20, 2009 22:48
Show Gist options
  • Select an option

  • Save cappuccino/82628 to your computer and use it in GitHub Desktop.

Select an option

Save cappuccino/82628 to your computer and use it in GitHub Desktop.
if (imageCache[filename])
{
self.beginBitmapFill(imageCache[filename]);
self.moveTo(x, y);
self.lineTo(x+width, y);
self.lineTo(x+width, y+height);
self.lineTo(x, y+height);
self.lineTo(x, y);
self.endFill();
}
else
{
var imageHolder = self.createEmptyMovieClip("cheese", 999),
loaderCallback = new Object(),
redrawFunction = self.execute;
loaderCallback.onLoadComplete = function() {
var bmd = new BitmapData(imageHolder._width, imageHolder._height, true, 0);
bmd.draw(imageHolder);
imageHolder.unloadMovie();
imageCache[filename] = bmd;
redrawFunction(codesString, imageCache);
};
var loader = new MovieClipLoader();
loader.addListener(loaderCallback);
loader.loadClip(filename, imageHolder);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment