Assigning attributes to an object
Hi, I'm trying to make a game so testing out a lot of interactions between different objects and time frames.
Currently, I have a red box and a green box. I wrote some keyboard listeners and the green box can move left and right
with the left/right arrow keys (the code is inside the object (green).(pic1)

I have a red box that moves up and down with a tween(pic2) and once it reaches the end of the tween, it loops back
to the beginning. If (notice == true) on frame 21 however, it will go to the next frame, where it will become blue and stop on that frame.

With my trace, I know the hitTest works and produces true when the green and red box overlap, however:
Goal: My goal is to make it so when the green box touches(with hitTestObject) the red box, the variable notice becomes true
and when the red box reaches frame 21, (notice == true) becomes true and goes to frame 22.
Question: I guess the ultimate question is how I can assign an attribute/variable to an object, and be able to retrieve the
value of that attribute/variable from both inside or outside the object.
Thanks