3 Replies Latest reply on May 20, 2010 8:50 PM by jimmyoneshot

    Getting DragSource of an Image Dragged From a TileList Working Correctly

    jimmyoneshot Level 1

      I have a tilelist populated by an array collection retrieved dynamically. The icons of each of the items in my tilelist have their source as website stored images. I'm trying to set it up so that as each item is dragged from my tilelist the item image shows during the drag but at the moment the icon image simply disappears during drag. I've been trying to get the following code to work :-




      private function initiateDrag(event:MouseEvent):void {


      var dragInitiator:Image = event.currentTarget as Image;


      var source:DragSource = new DragSource();




      var proxy:Image = new Image();

      proxy.source = dragInitiator.source;

      proxy.width = 50;

      proxy.height = 50;

      DragManager.doDrag(dragInitiator, source, event, proxy);







      I've also added in the initiateDrag(event) code to the mouseDown property of my tilelist but when I run it and hold the mouse down on my tilelist  I get a "Cannot access a property or method of a null object reference." error pointing to the proxy.source = dragInitiator.source line.


      Can anyone help me out with this?