I am trying to make some kind of interactive map with KineticJS, where freezing places make other images load. But I can not work correctly with mouse events. The fact is that everything works fine , but only with the first mouse attempt , and when I find the second time, the mouseout trigger does not work :(
i.e. When I do a "mouseout" a second time, I want the part of the map to be light blue again (image n_amer), but it restores dark blue (image n_amer_sel).
Here is a link where you can see this error: http://kinlibtst.elitno.net/
I will be very grateful for your help!
code:
function loadImages(sources, callback) { var assetDir = 'PROJECT/'; var images = {}; var loadedImages = 0; var numImages = 0; for(var src in sources) { numImages++; } for(var src in sources) { images[src] = new Image(); images[src].onload = function() { if(++loadedImages >= numImages) { callback(images); } }; images[src].src = assetDir + sources[src]; } } function initStage(images) { var stage = new Kinetic.Stage({ container: 'container', width: 900, height: 452 }); var imagesLayer = new Kinetic.Layer();
source share