Depending on how you change the canvas background color, you may have written that code incorrectly and are always changing the last instance. Watch out for those anonymous functions, they can be tricky to get right.
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of applecoremilo Sent: Wednesday, January 16, 2008 9:58 PM To: [email protected] Subject: [flexcomponents] Extended Canvas with Event Listener of drag enter - n00b I'm trying to add an eventListener to my extended Canvas Class but seem to be having a slight problem. I've created a loop which runs 16 times (in the main mxml component), it adds a new instance of the canvas to a container and sets an drag enter event listener for each one, however when i drag over any of teh canvas' only one the last one added reacts to the drag enter - regardless of where i drag the object. Am i going about this the wrong way? any help would be appreciated.. heres some example code for(var i = 0; i < 16;i++) { var foo:extendedCanvasObj = new extendedCanvasObj(); foo.setstyle....... foo.addEventListener(dragEvent.DRAG_ENTER,function (event:DragEvent) {change the canvas backgroundcolour }; container.addChild(foo); }
