Action Script gets ignored when the object is not Visible

I spent days trying to get help for that so I'll seriously be happy if someone has the answer.
I have a simple drag and drop of the game user drop off items in a bag and they disappear obtaining or losing points as they.

THE PROBLEM!
Is not a little funny flash where it does not update the variable "score" (action is not all the script) because the object no longer exists! I tried to do without making objects disappear when dropped on the bag and updates the score normally.

Someone at - there a way around this? I thought I'd put as a button that checks all the visible objects and establishes points in this way but I do not know where to start on this.

Here is the code I put on each object...

on {(press)
StartDrag("");
}

on (release) {}
If (_droptarget == 'Bag') {}
setProperty (root.rangerssocks, _visible, 0);
score = score + 1
}
on the other
{
StopDrag();
}
}


Make sure that the score is a level _root variable and update that way. as you now, score is on the dragged item so it's a question of importance. in frame 1 of the movie root, add

score = 0; (at the beginning that initializes your score to 0)

then press the buttons make a
_root.score += 1;

Tags: Adobe Animate

Similar Questions

Maybe you are looking for