8 Replies Latest reply on Jun 28, 2006 11:26 AM by Newsgroup_User

    Basic Question About an "If Statement"

      Hi, I'm new to Flash and programming in general, so this question may seem very basic and easy for most of you. I'm working on a "Catching" game where the objective is to catch objects falling out of the sky. I already have it programmed to where I can get things to fall out of the sky, and can duplicate them also to have multiple things fall out of the sky. What I want though, is to have only one object fall until it has fallen 15 times, the have it duplicate it after and have 2 things fall. I'm trying to use an if statement to check if it has dropped 15 times, and if it has, then it will duplicate the object and have 2 objects fall. Here is my code regarding the if statement:

      if (dropped = 15){
      enemy1.duplicateMovieClip( "enemy"+2, 100 );

      The problem is that insead of evaluating wether or not dropped is equal to 15, it sets dropped to 15 and executes the code to duplicate. I don't know what im doing wrong, it seems like it should work. If anyone can help me out it would be appreciated.

      Also, I have a counter in my code to keep track of how many times it has fallen.