[flexcoders] Re: Flex 3 DragManager with dynamic image proxy

2009-01-16 Thread dannyocean7722
Hi Tracy,

thanks for the idea. But this solution doesn't work for me either. 

I assume this function resides in a custom image class so you can pass this 
as drag 
initiator. In this case an image (thats already loaded - so you can access 
this.content 
without any problems). But if I try to load a image with the loader class... 
wait for the 
Event.COMPLETE and try to use image.content it doesn't show up.

Very strange. This drives me really crazy.

--- In flexcoders@yahoogroups.com, Tracy Spratt tspr...@... wrote:

 I found this post just the other day, and it appears to bear on your
 issue:
 
 http://www.arlingtondev.com/thoughts/?p=17
 
  
 
 But I cannot figure out how it would work.  Particularly the line:
 
 var bmp:Bitmap = new Bitmap(Bitmap(this.content).bitmapData);
 
 More particularly, this expression: 
 
 this.content
 
 I guess I don't really understand what this is in this context.
 Somehow it has to be the Image, since content is a property on Image
 (that makes sense, it is the actual image in the Image control).  But
 for this to be the image contol, the scope of the mouseMoveHandler,
 must be the Image control.  That would be a renderer, hmm, maybe I am
 seeig it.
 
  
 
 Maybe it will make sense to you.
 
 Tracy Spratt 
 Lariat Services 
 
 Flex development bandwidth available 
 
 
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
 Behalf Of dannyocean7722
 Sent: Thursday, January 15, 2009 4:06 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Flex 3 DragManager with dynamic image proxy
 
  
 
 Hi there,
 
 I'm struggeling with the drag manager and external loaded dynamic
 images. I do need this 
 for controls with no images displayed. (i.e. dragging with an advanced
 datagrid should 
 display a image corresponding to the selected data row - So I do need to
 load the image 
 on demand).
 
 if i use
 
 [Bindable]
 [Embed(source='myImage.png')]
 public var theImage:Class;
 
 [...]
 
 var imageProxy:Image = new Image();
 imageProxy.source = theImage;
 imageProxy.width = 120;
 imageProxy.width = 120;
 
 it works perfect. (Because the image is still preloaded I assume)
 
 But if I use:
 
 var imageProxy:Image = new Image();
 imageProxy.source = 'myImage.png' //Normally I would load here my
 dynamic image
 imageProxy.width = 120;
 imageProxy.width = 120;
 
 the image isn't displayed.
 
 I've tried everything. (Wait until the image is loaded with an event
 listener won't work 
 either). I've tried also to drag the image to a new bitmapasset ... but
 no way.
 
 Maybe somebody help me out of the jungle? :)
 
 Many thanks!
 Dan






[flexcoders] Flex 3 DragManager with dynamic image proxy

2009-01-15 Thread dannyocean7722
Hi there,

I'm struggeling with the drag manager and external loaded dynamic images. I do 
need this 
for controls with no images displayed. (i.e. dragging with an advanced datagrid 
should 
display a image corresponding to the selected data row - So I do need to load 
the image 
on demand).

if i use

[Bindable]
[Embed(source='myImage.png')]
public var theImage:Class;

[...]

var imageProxy:Image = new Image();
imageProxy.source = theImage;
imageProxy.width = 120;
imageProxy.width = 120;

it works perfect. (Because the image is still preloaded I assume)

But if I use:

var imageProxy:Image = new Image();
imageProxy.source = 'myImage.png' //Normally I would load here my dynamic image
imageProxy.width = 120;
imageProxy.width = 120;

the image isn't displayed.

I've tried everything. (Wait until the image is loaded with an event listener 
won't work 
either). I've tried also to drag the image to a new bitmapasset ... but no way.

Maybe somebody help me out of the jungle? :)

Many thanks!
Dan