random() problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • malmus
    New Member
    • Jan 2008
    • 18

    random() problem

    rand = random(4);

    why does the debug give me this error below??

    1180: Call to a possibly undefined method random.

    Please help

    Thanks
  • nomad
    Recognized Expert Contributor
    • Mar 2007
    • 664

    #2
    Originally posted by malmus
    rand = random(4);

    why does the debug give me this error below??

    1180: Call to a possibly undefined method random.

    Please help

    Thanks
    can you share a little more code

    nomad

    Comment

    • malmus
      New Member
      • Jan 2008
      • 18

      #3
      Originally posted by nomad
      can you share a little more code

      nomad

      i am sharing it all here

      var myArray = new Array();
      var skipped;
      var rand:Number;

      myArray[0] = "100";
      myArray[1] = "200";
      myArray[2] = "300";
      myArray[3] = "400";

      if(skipped!=tru e)
      {
      rand = random(4);
      skipped=true;
      gotoAndPlay(myA rray[rand]);
      }

      what i want to do is load a number from the array!!

      Comment

      Working...