6 Replies Latest reply on Jun 18, 2008 3:57 PM by kglad

    Problem Loading Variables and comparing loaded var with if statement

    Alfarovive Level 1

      I am loading variable strings from a textfile using:
      loadVariables ("Map/lotes.txt", loteData);

      The text file has the strings in the following format:
      &lote1=H506,01,El Gaucho,Restaurante

      Then I am splitting the string using:

      lote = loteData .split(",");

      lote[0] should be H506
      lote[1] should be 01
      lote[2] should be El Gaucho
      lote[3] should be Restaurante

      I have already have instances loaded in the movie named the same as a concatanation of lote[0] and lote[1] nested inside another clip named the same as lote[0] all inside other clips the path is:

      I am atatching a variable loteType to the instance :
      _root.Map.Map[lote[0]][lote[0]+[lote[1]]].loteType = lote[3];

      But when I want to check if the variable matches a test string I do not get a match:
      if (_root.Map.Map[lote[0]][lote[0]+[lote[1]]].loteType == "Restaurante") {
      trace("This is a Restaurant");}

      Whats wrong? Is it that the variable is not declared as a character string? I cant figure it out. I also am having