In an Adobe Animate HTML5/JavaScript Canvas movie, I have a draggable Movie Clip symbol being added to another Movie Clip symbol on hitBox.hitTest
.
function onMouseUp(evt){
var item = evt.currentTarget;
item.drag = false;
var pt = item.localToLocal(item.dot.x, item.dot.y, item.LFLensHolder.hitBox);
if(item.LFLensHolder.hitBox.hitTest(pt.x, pt.y) ){
item.x = item.LFLensHolder.x;
item.y = item.LFLensHolder.y;
item.lensParentLeft.addChild(item);
console.log(item.parent);
}
}
In this instance, the item symbol instance name is ConcaveSphereLens…
However, the draggable item disappears on hitBox.hitTest
, that is, when the drggable item snaps to position, it just disappears. Very odd.
Looking at browser console on hitTest
with console.log(item.parent);
I can see that the draggable item has a parent of lensParentLeft
which it should have.
I can also see that the draggable item, now a child of lensParentLeft
has properties which indicate it is on stage and visible.
I’m not sure what is going wrong. Any ideas?
and the properties in console for the dragged child item…