3 Replies Latest reply on Aug 27, 2012 7:05 AM by A.kameshwaran

    simultaneous dislpay of Movieclip

    A.kameshwaran Level 1

      Hi,

       

           I am copying multiple(for ex 10) places of a image using bitmap and displaying it in the stage.  I am getting the exact result after the complettion all the input(10 places).

       

      But my query is, how can i make croped movieclip to be visible once it is done, instead of waiting for other movieclips to be completed.

       

      Kindly advise me.

       

      Regards,

      Kameshwaran A.

        • 1. Re: simultaneous dislpay of Movieclip
          A.kameshwaran Level 1

          I have got the solution

          • 2. Re: simultaneous dislpay of Movieclip
            Ned Murphy Adobe Community Professional & MVP

            Please share what you found so that others might benefit from your posting.  If you have been helped by others in these forums, this is your chance to pay it forward.

            • 3. Re: simultaneous dislpay of Movieclip
              A.kameshwaran Level 1

              Sure Murphy. Also, i have resolved the recursive function restriction 

                       

              256 levels of recursion were exceeded in one action list.

              This is probably an infinite loop.

              Further execution of actions has been disabled in this movie.

               

              I have used timeinterval function to overcome my above said problem also it avoids the recursive restriction. Inorder to make it clear i have made a small sample,

               

              var i = 1;

              var nextMcXPos:Number = 0;

              var nextMcYPos:Number = 0;

              var mcGap:Number = 5;

              var w:Number = 20;

              var h:Number = 20;

              var maxCnt:Number = 500;

              var rectFnRewoke;

               

              /****

                   In below function you can see rectangle will be displayed all in a moment and you will get the recursive function error.

              ****/

              function cRect(){

                  rect = _root.createEmptyMovieClip("rect"+i,_root.getNextHighestDepth());

                  with(rect)

                  {

                      beginFill(0xff0000,100)

                      lineStyle(1,0x3e3e3e);

                      moveTo(0,0);

                      lineTo(w,0);

                      lineTo(w,h);

                      lineTo(0,h);

                      lineTo(0,0);

                      _x = nextMcXPos;

                      _y = nextMcYPos;

                  }

                  if(i < maxCnt)

                  {

                      nextMcXPos = nextMcXPos + rect._width + mcGap;

                      if(i%5 == 0)

                      {

                          nextMcYPos = nextMcYPos + rect._height + mcGap;

                          nextMcXPos = 0;

                      }

                      i = i+1;

                     

                      cRect()

                  }

              }

               

               

              cRect();

               

              /****

                   By replacing the below function, i have achieved what exactly i was looking.

              ****/

               

              function cRect(){

                  rect = _root.createEmptyMovieClip("rect"+i,_root.getNextHighestDepth());

                  with(rect)

                  {

                      beginFill(0xff0000,100)

                      lineStyle(1,0x3e3e3e);

                      moveTo(0,0);

                      lineTo(w,0);

                      lineTo(w,h);

                      lineTo(0,h);

                      lineTo(0,0);

                      _x = nextMcXPos;

                      _y = nextMcYPos;

                  }

                  if(i < maxCnt)

                  {

                      nextMcXPos = nextMcXPos + rect._width + mcGap;

                      if(i%5 == 0)

                      {

                          nextMcYPos = nextMcYPos + rect._height + mcGap;

                          nextMcXPos = 0;

                      }

                      i = i+1;

                      clearInterval(rectFnRewoke);    // clears the interval

                      rectFnRewoke = setInterval(cRect, 10); // Recalls the function

                  }

                   else

                   {

                        clearInterval(rectFnRewoke);   // clear the interval in the final execution

                   }

              }

               

              Murphy, Kindly tell me if you find anything wrong in my above mode of writting the code.