0 Replies Latest reply on Feb 21, 2013 7:50 PM by chanojuano

    hiTest() a la actionscript 1 style

    chanojuano

      Hi after getting resolve a silly sintax mistake i was able to implemente my idea and implemente a still glitch hitTest like on the actionscript1 times, with the right work it could work for simple games with more variables, ill just gonna put u link to files so all of u like I without javascript experience can deconstruct it.

       

      mazatlanonline.net/canon1.rar

       

      hope is usefull for some ill brieflly explain

       

      Basiclly 2 symbols have a close, medium and far variables, that when they match they reset playback to frame1

       

      so with an if else in timeline it kind of does things and simulates the collision

       

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

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

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

      var mymalo = sym.getComposition().getStage().getSymbol("malillo").getVariable("malo");

      //alert(mymalo);

       

       

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

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

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

       

       

                sym.getComposition().getStage().getSymbol("malillo").play("reset");

                sym.getComposition().getStage().getSymbol("canion2").getSymbol("bala3").stop(1);

                sym.setVariable("mybala", "");

                sym.setVariable("mymalo", "");

       

       

      }