Making loaded image draggable actionscript 3 -
I want to load an image from the load using the loader and then I want to make it dragable. Tile list is being selected by loading as shown below, but I have no information about drag and drop in AS3, can anyone help me? I want to make it as simple as possible.
Here is my code to load the image:
var charge1: loader = new loader (); AddChild (charge1); This.addChildAt (Charge 1, getChildIndex (BG)); Charge1.x = 280; Charge1.y = 270; ... function set Charge 1 (E: Event): Zero {trace (e.target.selectedItem.source); This.charge1.load (new URLRequest (e.target.selectedItem.source)); This.charge1.contentLoaderInfo.addEventListener (Event.COMPLETE, onComplete); } Yuku was going with the correct rows but what you want to do is loader. The content of information that is actually a clip that is loaded into a personal function (event: event) on . Zero {var loadedClip: MovieClip = LoaderInfo (event.target). material ; LoadedClip.addEventListener (MouseEvent.MOUSE_DOWN, function (Event: MouseEvent) {loadedClip.startDrag ();}); Stage.addEventListener (MouseEvent.MOUSE_UP, function (Event: MouseEvent) {loadedClip.stopDrag ();}); }
Comments
Post a Comment