tags:

views:

38

answers:

1

I have a canvas which I want to accept drags on.

I have added a dragOver and dragEnter event listeners to the canvas, but they only work if I drag over something inside the canvas (another child element).

I realised that if I set the canvas' background colour to black it works. So I have set it's background transparency to 0, which works... buy is there a better way to work around this apparent need for the canvas to have something inside it to accept dragEvents.

Thanks

Rob

A: 

According to one of the Flex developers, "In Flash there is a difference between a transparent pixel and an area in a Sprite that hasn't been drawn on at all." (http://www.mail-archive.com/[email protected]/msg127690.html)

I'm guessing this is the reason why you need to have the transparent background. For what it's worth, this is always the way I've seen this problem solved. There is also this question which talks about this problem.

Hope this helps!

Wesley Petrowski