Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Check if function is not being used

New Here ,
Jun 13, 2013 Jun 13, 2013

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.

TOPICS
ActionScript
495
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 13, 2013 Jun 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jun 14, 2013 Jun 14, 2013
LATEST

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)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines