I want this a-box to turn red when I look at it, and turn white when I look away. However, I'm getting this weird flickery behavior whenever the cursor is overlapping with the cube. Here's the code for the object:
<a-box position="0.5 0.5 -3" rotation="0 45 0" color="white"
animation__mouseenter="
property: color;
to: #ff0000;
dur: 1;
startEvents: mouseenter;
"
animation__mouseleave="
property: color;
to: #ffffff;
dur: 1;
startEvents: mouseleave;
">
</a-box>
Unfortunately, Stack Overflow won't let me insert a gif demonstrating the problem as it's too large. I'm on Aframe 1.5.0, so maybe you'll be able to reproduce the problem.
I tried changing the animation component to animation__mouseenter and using mouseenter as the startEvents. I was expecting the box to change its color to red the frame the cursor looks at it, stay red, and turn back to white the frame the cursor looks away.
I tried using your code within a scene and it works fine. My suspect is that there is something wrong in some other parts of the code, probably in regards to the cursor/raycaster. Anyway, this is a working sample: