0 Replies Latest reply on Apr 13, 2010 7:23 PM by JaxNa

    How to Move in Y axis column

    JaxNa

       

      this is a code of creting a grid.
      //************************************************Reel Code START*****************************************
      var my_str:String = "1,2,3,4,5,6,7,8,9,10,1,2,3,4,5";
      var display_array:Array = my_str.split(",");
      _global.speed = 200;
      _global.counter = 0;
      _global.WheelInterval = 100;
      _global.pressnextbtn = false;
      _global.pressPrebtn = false;
      _global.pressnextbtnBet = false;
      _global.pressPrebtnBet = false;
      _global.lines = 25;
      txt_lines.text = 25;
      onEnterFrame = function () {;
      if (_global.pressnextbtn == true) {
          if (_global.lines<25) {
              _global.lines = _global.lines+1;
              txt_lines.text = _global.lines;
          }
      }
      if (_global.pressPrebtn == true) {
          if (_global.lines>1) {
              _global.lines = _global.lines-1;
              txt_lines.text = _global.lines;
          }
      }
      if (_global.pressnextbtnBet == true) {
          if (_global.linesbet<100) {
              _global.linesbet = _global.linesbet+1;
              txt_bet.text = "0."+_global.linesbet;
          }
          if (_global.linesbet == 100) {
              txt_bet.text = "1.00";
          }
      }
      if (_global.pressPrebtnBet == true) {
          if (_global.linesbet>1) {
              _global.linesbet = _global.linesbet-1;
              txt_bet.text = "0."+_global.linesbet;
          }
      }
      };

       

      nextline_btn.onPress = function() {
          _global.pressnextbtn = true;
      };
      nextline_btn.onRelease = function() {
          _global.pressnextbtn = false;
      };
      prevline_btn.onPress = function() {
          _global.pressPrebtn = true;
      };
      prevline_btn.onRelease = function() {
          _global.pressPrebtn = false;
      };

       

      _global.linesbet = 1;
      txt_bet.text = "0."+_global.linesbet;

       

      nextlinebet_btn.onPress = function() {
         
          _global.pressnextbtnBet = true;
      };
      nextlinebet_btn.onRelease = function() {
          _global.pressnextbtnBet = false;
      };
      prevlinebet_btn.onPress = function() {
          _global.pressPrebtnBet = true;
      };
      prevlinebet_btn.onRelease = function() {
          _global.pressPrebtnBet = false;
      };

       


      //****************************************Dot Net Variable**********************************************
      var reel_array:String = ("3,1,2,7,10,8,6,7,4,2,3,8,5,3,1,9,@10,6,1,8,4,3,5,9,1,2,2,8,3,7,3,7,@2,4,2,1,1 ,3,8,3,7,10,9,3,8,7,5,6,@2,6,5,8,1,7,2,9,4,10,3,8,7,1,3,3,@8,3,4,1,7,2,1,2,10,8, 6,3,3,9,7,5,@");
      //****************************************Dot Net Variable**********************************************

       

      var my_array:Array = reel_array.split("@");
      var randomno:Array = new Array(my_array.length-1);
      var reel_array:Array = new Array(my_array.length-1);
      for (var k = 0; k<(my_array.length-1); k++) {
          reel_array[k] = my_array[k].split(",");
          randomno[k] = random(16);
      }

       


      _root.createEmptyMovieClip("sq_mc",this.getNextHighestDepth());
      sq_mc._x = 147;
      sq_mc._y = 336;
      var myObj:Object = new Object();
      myObj.rows = 16;
      myObj.columns = 5;
      myObj.space = 61;
      myObj.depth = 1;
      myObj.path = _root.sq_mc;

       

      function createGrid():Void {
          for (var j:Number = 0; j<myObj.rows; ++j) {
              for (var i:Number = 0; i<myObj.columns; ++i) {
                  var name:String = "cell"+i+"_"+j;
                  var x:Number = (i)*myObj.space;
                  var y:Number = (j)*myObj.space;
                  myObj.path.attachMovie("box_mc",name,++myObj.depth);
                  myObj.path[name]._x = x;
                  myObj.path[name]._y = -y;
                  myObj.path[name].createEmptyMovieClip("holder_mc",this.getNextHighestDepth());
                  var ind:Number = randomno[i]+(j-1);
                  if (ind<0) {
                      ind = 15;
                  } else if (ind>15) {
                      ind = 0;
                  }
                  myObj.path[name].holder_mc.loadMovie("images/jackpot/"+reel_array[i][ind]+".jpg ");

       

              }
          }
      }
      createGrid();

       

      spinImages = function () {
          for (var k = 0; k<(randomno.length); k++) {
              var n:Number = randomno[k];
              if (n<15) {
                  randomno[k] = n+1;
              } else {
                  randomno[k] = 0;
              }
          }
         
          setImages();
          _global.counter = _global.counter+10;
          if (_global.counter<_global.speed) {
              setTimeout(this,'spinImages',_global.WheelInterval);
          } else {
              _global.counter = 0;
              displayImages();
          }
      };

       

      btnSpin.onRelease = function() {
          spinImages();
      };

       

      setImages = function () {
          for (var i:Number = 0; i<myObj.columns; ++i) {
              for (var j:Number = 0; j<myObj.rows; ++j) {
                  var str:String = "cell"+i+"_"+j;
                  var ind:Number = randomno[i]+(j-1);
                  if (ind<0) {
                      ind = 15;
                  } else if (ind>15) {
                      ind = 0;
                  }
                  myObj.path[str].holder_mc.loadMovie("images/jackpot/"+reel_array[i][ind]+".jpg" );
                  myObj.path[str].holder_mc._alpha = 100
              }
          }
      };

       

      displayImages = function () {
          for (var j:Number = 0; j<myObj.rows; j++) {
              for (var i:Number = 0; i<myObj.columns; i++) {
                  var str:String = "cell"+i+"_"+j;
                  myObj.path[str].holder_mc.loadMovie("images/jackpot/"+display_array[i+(j*5)]+". jpg");
                 
                  }
              }
              heighLight()
             
             
      };
      //******************************************HeighLight Image********************************************
      this.createEmptyMovieClip("line_mc",this.getNextHighestDepth());
                  line_mc.lineStyle(2,0x00000,100);

       

      var line_details:Array =new Array(25);
      line_details[0] = "2,2,2,2,2,";
      line_details[1] = "1,1,1,1,1,";
      line_details[2] = "3,3,3,3,3,";
      for(var i=3; i<line_details.length;i++){
          line_details[i] = "2,2,2,2,2,";
      }
      var reelBlink_string:String = ("Line:1:0.1:2,Line:2:0.1:3,Line:3:0.1:4,");
      var lines_array:Array = reelBlink_string.split(",");
      var reelBlink_array:Array = new Array(4);
      heighLight=function(){
          for (var k = 0; k<(lines_array.length-1); k++) {
              reelBlink_array = lines_array[k].split(":");
              var line_no:Number = reelBlink_array[1];
              var high:Number = reelBlink_array[3];
              var line_string = line_details[line_no-1];
              var col_array:Array = line_string.split(",");
              for (var n:Number=0;n<high;n++){
                      var str:String = "cell"+n+"_"+(col_array[n]-1);
                      myObj.path[str].holder_mc._alpha = 30
                     
                      }
              }
                 
          }

       

      //************************************************Reel Code END*****************************************

       

       

      Any one help me plz.

       

      i want to spin grid of colum on button relese..

      now i have done only changed images in column on button relese.

      but i want move in Y-axis from top to bottom.

       

       

      Please help me..

      Thanks