2 Replies Latest reply on Feb 21, 2013 6:39 PM by chanojuano

    Targeting variables in other symbols

    chanojuano

      I am trying still to simulate a collision funcionality, so i tought that if i put a bullet, wich will say, close, far, not so far, and a matching enemy variable i could make illusion of this. so i been able to compare variables in symbol and if else acording the response, but i want to do a & statement to compare the 2 variables in the 2 symbols and i been unsuccesfull, this is what i have:

       

      sym.setVariable("bala", "close");

      //obtener el valor de un símbolo de variable

      var mybala = sym.getVariable("bala");

      //alert(mybala);

       

       

      if (mymalo == "close" & mybala == "close"){

                //sym.getComposition().getStage().getSymbol("colores").play("verde");

                //sym.getComposition().getStage().getSymbol("gradient").play("tres");

       

       

       

       

                alert("both true")

                // detener la línea de tiempo en la posición determinada (ms o etiqueta)

       

      }

       

      I know i must do a complete target path for the variables but dont know how to do it on edge! here is the files: http://mazatlanonline.net/canion2.rar

       

      I try to do full path with this but it dint work

       

      if (sym.getComposition().getStage().getSymbol("malo").getVariable("mymalo") == "close" & sym.getComposition().getStage().getSymbol("canion2").getSymbol("bala2").getVariable("myba la") == "close"){

       

       

                alert("both true")

                // detener la línea de tiempo en la posición determinada (ms o etiqueta)

      }

       

      but no alert!

       

       

      thanks a lot for the help buddies