i want to load an image to stage using Loader and then I want to make it draggable. Loading is done by selecting from tilelist as seen below, but I have no idea about drag and drop in AS3, can anybody help me? I want to make it as simple as possible.
Here is my code to load image:
var charge1:Loader = new Loader(); addChild(charge1); this.addChildAt(charge1, getChildIndex(bg)); charge1.x = 280; charge1.y = 270; ... function setCharge1(e:Event):void{ trace(e.target.selectedItem.source); this.charge1.load(new URLRequest(e.target.selectedItem.source)); this.charge1.contentLoaderInfo.addEventListener(Event.COMPLETE,onComplete); }
yuku was going along the right lines but what you want to do is get the contents of the loaderInfo which is actually the clip that is loaded in. something like