Thursday, 26 September 2013

KineticJS layer.get() finds non existent shapes

KineticJS layer.get() finds non existent shapes

I'm experiencing some troubles with KinectJS when I try to get a rectangle
using its id. Take a look at my code here:
var obj = null;
obj = myLayer.get("#asd");
if (obj != null) {
console.log(obj);
}
There are no shapes with #asd - but obj still isn't null. When I log it in
the console i get:
[each: function, toArray: function, on: function, off: function, remove:
function…]
What I want is to check if it found the shape with id #asd. How can I do
that?

No comments:

Post a Comment