Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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)
Find more inspiration, events, and resources on the new Adobe Community
Explore Now