Flex: Duplicating instance of an image -


In my Flex application I have a drag and drop handler I drag proxy, or 'ghost' being displayed while dragging the picture It should be before I drag, and it takes some time. How can I load it or load it in advance? A solution is to duplicate the image, but as far as I know, image objects can not be duplicated without making another variable, which should still take some time to load.

Perhaps this code will better describe it to:

  Public Function DragApp (e: MouseEvent): Zero {var dragInitiator: Image = e.currentTarget as Image; Var Dragosource: DragSource = New Dragosource (); Var DragProx: image = new image (); DragProxy.source = e.currentTarget.source; // will not work unless the image dragproc.load (e.currentTarget.source) is embedded; // must set the timeout (draggener. Drag, 350, drag inverters, dragers, e, dragproces); }  

I believe the problem is that you do not set the width and height Image (somehow unnecessary for embedded pictures):

Drag image: IFlexDisplayObject (default = null) - drawings to draw. This argument is optional; A standard drag rectangle is used during the drag and drop operation. If you specify an image, You must explicitly set the height and width of the image otherwise it will not be visible

If you have an image in your example If you set a width and height for the proxy, then this will probably work:

  var dragProxy: Image = new Image (); DragProxy.source = dragInitiator.source; DragProxy.width = dragInitiator.width; DragProxy.height = dragInitiator.height;  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -