3 Replies Latest reply on Dec 2, 2008 4:19 PM by alamandaholly

    Problems with variables

    alamandaholly
      I am currently working on a small game that is similar to Mystery Case Files, but much simpler for my kids. The game is working as I want it, but I would like to go back and make some of my code more efficient. I am trying to get the instance name of a movieclip, change the name slightly and then use that value to control a similar movie clip.

      I have used trace to make sure that it picked up the instance name OK, and it does - it spits out pigletlge, which is the name of the other movie clip. Out of the two lines of code that begin with "if", the first works, but the second doesn't. I would have thought that, since the variable seems to hold the same value as the name of the other movie clip, then the two lines would do exactly the same thing. I have tried explicitly making the variable a string, but that doesn't seem to help.

      Anyone got any ideas, or am I missing something really obvious?