Problem:
I have created a buttons with setInterval so that it can call the function till the button will be pressed.
onRelease of button I 'm clearing the interval.
It is working fine.
It gives problem when I’m pressing a button and moving the cursor out of that button area and releasing, it does not call the onRelease event and hence the function goes in the infinite loop.
_level0.main.btn_SizePlus.onPress = function()
{
if(plusint != null)
{
clearInterval(plusint);
}
plusint = setInterval(SizePlus,20);
};
_level0.main.btn_SizePlus.onRelease = function()
{
clearInterval(plusint);
};
Please help!!