7 Replies Latest reply on Apr 9, 2012 8:38 AM by markerline

    Random Array?


      Im making a random drop item system.


      I was thinking of making a array like this:


      var Items:Array = ["HP","ST","SWORD"]




      if(Items == SWORD){

      //drop sword

      //do code here



      but i have no idea of how to access and use 1 value from an array.


      I think i need to use something like math.floor or math.random but i dont know how to go foward with this.



      Thanks in advance.