Skip to main content
Known Participant
June 13, 2013
Question

Check if function is not being used

  • June 13, 2013
  • 2 replies
  • 511 views

Hey all,

I am wondering if there is a way to write an if statement that asks if a function is not currently being used. For instance, I have a couple of movie clips. If one is clicked, I have a mouse event function that does something. I also have a boolean called selected, which traces if it is currently the movie clip clicked. When I click another one, the boolean is returning true to a movie clip that I clicked previously. Meaning it's not the currently selected one. This always happen especially the first tile I click when the game starts.

This topic has been closed for replies.

2 replies

Inspiring
June 14, 2013

if you are using MovieClips you can dynamically create any property you need.

So instead of storing the selected property on the application level you could attach a selected property to each of your movieclips

Then push all your MovieClips into an Array and when you select a MovieClip, parse through the array and set all the mcs selected property to false (except the one you clicked last)

kglad
Community Expert
Community Expert
June 13, 2013

unless something is occuring asynchronously, your question makes no sense.  if something is occuring asynchronously you can assign a boolean at the start of the process and reassign it at the end of that process.