7 Replies Latest reply on Apr 14, 2010 10:57 PM by Kartik Mehta

    How I can stop the spinning of images.

    JaxNa Level 1

      //****************************************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,1 0,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);
      }
      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(",");

       

      _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;
      myObj.path.swapDepths(0)
      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 () {
          setImages();
          setImages1();
          setImages2();
          setImages3();
          setImages4();
         
      };

       

      matter_mc.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"+0+"_"+j;
                  var ind:Number = randomno[i]+(j-1);
                  myObj.path[str].holder_mc._alpha = 100
                  myObj.path[str]._y++
                  trace("y="+myObj.path[str]._y)
                  if(myObj.path[str]._y>60){
                      myObj.path[str]._y=-915
                  }
              }
          }
         
          setTimeout(this,'setImages',1)
         
      };

      setImages1 = function () {
          for (var i:Number = 0; i<myObj.columns; i++) {
              for (var j:Number = 0; j<myObj.rows; j++) {
                  var str:String = "cell"+1+"_"+j;
                  var ind:Number = randomno[i]+(j-1);
                  myObj.path[str].holder_mc._alpha = 100
                  myObj.path[str]._y++
                  if(myObj.path[str]._y>60){
                      myObj.path[str]._y=-915
                  }
              }
          }
         
          setTimeout(this,'setImages1',5)
      };
      setImages2 = function () {
          for (var i:Number = 0; i<myObj.columns; i++) {
              for (var j:Number = 0; j<myObj.rows; j++) {
                  var str:String = "cell"+2+"_"+j;
                  var ind:Number = randomno[i]+(j-1);
                  myObj.path[str].holder_mc._alpha = 100
                  myObj.path[str]._y++
                  if(myObj.path[str]._y>60){
                      myObj.path[str]._y=-915
                  }
              }
          }
          setTimeout(this,'setImages2',10)
      };
      setImages3 = function () {
          for (var i:Number = 0; i<myObj.columns; i++) {
              for (var j:Number = 0; j<myObj.rows; j++) {
                  var str:String = "cell"+3+"_"+j;
                  var ind:Number = randomno[i]+(j-1);
                  myObj.path[str].holder_mc._alpha = 100
                  myObj.path[str]._y++
                  if(myObj.path[str]._y>60){
                      myObj.path[str]._y=-915
                  }
              }
          }
          setTimeout(this,'setImages3',15)
      };
      setImages4 = function () {
          for (var i:Number = 0; i<myObj.columns; i++) {
              for (var j:Number = 0; j<myObj.rows; j++) {
                  var str:String = "cell"+4+"_"+j;
                  var ind:Number = randomno[i]+(j-1);
                  myObj.path[str].holder_mc._alpha = 100
                  myObj.path[str]._y++
                  if(myObj.path[str]._y>60){
                      myObj.path[str]._y=-915
                  }
              }
          }
          setTimeout(this,'setImages4',20)
      };

       

      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._y=-50
                  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
                     
                      }
              }
                 
          }

       

       

      (setImages) is function of first column for spinning of images, but i want to stop column wise on specifc speed.