2 Replies Latest reply on Sep 1, 2006 2:44 AM by varun.ks

    Creating Number matrices ?

    varun.ks
      Hi All


      I Have tried to create a number Matrix as follows: But it didn't worked. Can anybody suggest a way?

      var shPath_arr:Array = new Array();
      for (var i:Number=0; i<5; i++) {
      for (var j:Number =0; j<5; j++) {
      shPath_arr [j] = i+j;
      }
      }
      trace(shPath_arr);



      Varun
        • 1. Re: Creating Number matrices ?
          Level 7
          Hi!

          Almost there...


          var shPath_arr:Array = new Array();
          for (var i:Number=0; i<5; i++) {
          shPath_arr = new Array();
          for (var j:Number =0; j<5; j++) {
          shPath_arr
          [j] = i+j;
          }
          }
          trace(shPath_arr);

          /Jensen/
          "varun.ks" <webforumsuser@macromedia.com> wrote in message
          news:ed8qpv$8hv$1@forums.macromedia.com...
          > Hi All
          >
          >
          > I Have tried to create a number Matrix as follows: But it didn't worked.
          > Can
          > anybody suggest a way?
          >
          > var shPath_arr:Array = new Array();
          > for (var i:Number=0; i<5; i++) {
          > for (var j:Number =0; j<5; j++) {
          > shPath_arr [j] = i+j;
          > }
          > }
          > trace(shPath_arr);
          >
          >
          >
          > Varun
          >


          • 2. Re: Creating Number matrices ?
            varun.ks Level 1
            Hi

            Thanks. It is working

            regards

            Varun