3 Replies Latest reply on Dec 22, 2011 1:54 PM by kglad

    How do you stop a function?

    redsox05

      I have this code that I want to end on a specific frame? How would I do that? It could also be set to play 115 frames if that is easier thanks.

       

      screen_width=750

      screen_height=475

      frecuency=0//<< INCREASE NUMBER TO REDUCE PAPERS QUANTITY

      //

      //

       

      MovieClip.prototype.serConfeti=function  () {

          this._x=Math.ceil(Math.random()*screen_width)

          this._xscale=Math.ceil(Math.random()*screen_height)   

          this._yscale=this._xscale

          this.mover()

          this.coloreame()

         

      }

      function getPorcentaje() {

          var numero=Math.ceil(Math.random()*20)

          return numero

      }

      function getOffset() {

          var numero=Math.ceil(Math.random()*255)

          var buleano=Math.round(Math.random()*1)

          if (buleano==1) {

             

              numero=numero*1       

          }

          return numero

         

      }

       

      MovieClip.prototype.mover=function  () {

          this.onEnterFrame=function  () {

              if (this._y<475) {

                  this._y+=10

                  this._xscale=Math.random()*100

                  this._rotation=Math.random()*360

              } else {

                  this.removeMovieClip()   

              }

          }

       

      }

       

      MovieClip.prototype.caidaConfeti=function  () {   

              this.createEmptyMovieClip("caida_mc",1)

              var count=0

              var confCount=1       

              this.caida_mc.onEnterFrame=function  () {

                  if(count<frecuency){

                      count++

                  } else {

                      this.attachMovie("conf","conf"+confCount,confCount)

                      eval("this.caida_mc.conf"+confCount).serConfeti()               

                      count=1

                      confCount++           

                     

                  }

       

              }       

      }

      //

       

      _root.caidaConfeti()