Skip to content

Instantly share code, notes, and snippets.

@besquared
Created April 3, 2009 02:24
Show Gist options
  • Select an option

  • Save besquared/89610 to your computer and use it in GitHub Desktop.

Select an option

Save besquared/89610 to your computer and use it in GitHub Desktop.
function loadImage(type:String, name:String, src:String) {
var loader = new Loader();
function onLoadComplete(event:Event):void {
var thumbnail:Sprite = new Sprite();
thumbnail.addChild(loader);
//thumbnail.width = 100;
//thumbnail.height = 100;
thumbnail.x = 150;
thumbnail.y = 150;
if(type == 'shoes')
shoes.addChild(thumbnail);
if(type == 'tops')
tops.addChild(thumbnail);
thumbnail.addEventListener(MouseEvent.MOUSE_UP, dragFnstop);
thumbnail.addEventListener(MouseEvent.MOUSE_DOWN, dragFn);
function dragFn(event:MouseEvent){
thumbnail.startDrag();
};
function dragFnstop(event:MouseEvent){
thumbnail.stopDrag();
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment