3 Replies Latest reply on Feb 2, 2011 3:22 PM by kglad

    simple question!

    Barabazz

      Hi, i simply want the button to random between frame 2-53!  not 1-53..can u make it work : )

       

       

      here is my code:

       

       

      slump_btn.addEventListener (MouseEvent.CLICK, slumpa);

       

      function slumpa(event:MouseEvent):void {

       

      var faktanr : Number = 53;

       

      var slumpanr: Number = Math.ceil(Math.random() * faktanr);

       

      trace(slumpanr);

       

      gotoAndStop(slumpanr);

       

       

      }