4 Replies Latest reply on Jan 11, 2013 1:13 PM by gavindonegal

    could use help to make this conditional script auto play at makers

    gavindonegal

      I'm taking apart the timeline example animation to learn edge.

      There are 4 buttons for 4 different labels on the stage timeline. Each labels starts at a new symbol.

      The symbol's timelines have animations within them.

      Right now clicking the button sets a variable that moves the playhead to the corresponding label. Also there are forward and back arrow buttons.

      But it does a "go to and stop"  right now. I just want to make that "go to and play" so that the animation cycles automatically if the buttons are not being clicked.

       

      Button code:

       

      mouse over:

       

      // insert code for mouse enter here

       

      this.circleBtnSymbol = sym.getSymbol('btn_circle1');

      this.circleBtnSymbol.stop('on');

       

       

      mouse out:

      // insert code for mouse leave here

       

      if( this.activePanel != 1 )

      {

          this.circleBtnSymbol = sym.getSymbol('btn_circle1');

          this.circleBtnSymbol.stop('off');

      }

       

      click:

       

      // insert code for mouse clicks here

       

      this.onClickCircleBtn( 1 );

       

       

       

      stage timeline:

       

      // turn "on" first circle btn

      this.circleBtnSymbol = sym.getSymbol('btn_circle1');

      this.circleBtnSymbol.stop('on');

       

      // insert code for compositionReady event here

       

      // global vars

      this.activePanel = 1;

      this.prevPanel = 1;

      this.panelCount = 4;

      this.panelObject;// panel

      this.circleBtnSymbol;// circle btn

      this.arrowBtnSymbol;// arrow btn

       

      // turn "on" first circle btn

      sym.getSymbol('btn_circle1').stop('on');

       

       

       

      // called internally only

      this.changePanel = function()

      {   

          //-- change panel

       

          this.stop('panel'+this.activePanel);

       

          this.panelObject = sym.getSymbol('panel'+this.activePanel);

          this.panelObject.play(0);

       

       

          //-- set states of circle btn

       

          // deactivate all btns

          var i=1;

          for( i=1; i<=this.panelCount; i++ )

          {

              this.circleBtnSymbol = sym.getSymbol('btn_circle'+i);

              this.circleBtnSymbol.stop('off');

          }

       

          // set active btn

          this.circleBtnSymbol = sym.getSymbol('btn_circle'+this.activePanel);

          this.circleBtnSymbol.stop('on');

       

          //console.log('this.activePanel = '+this.activePanel);

      }

       

      this.onClickCircleBtn = function( arg )

      {

          //console.log('onClickCircleBtn');

       

          if( arg != this.activePanel )

          {

              this.activePanel = arg;

       

              this.stop('panel'+this.activePanel);

       

              this.panelObject = sym.getSymbol('panel'+this.activePanel);

              this.panelObject.play(0);

       

              this.changePanel();

          }

      }

       

      this.onClickLeftArrow = function()

      {

          //console.log('onClickLeftArrow');

       

          if( this.activePanel > 1 )

          {   

              this.activePanel--;

          }else{

              this.activePanel = this.panelCount;

          }

          this.changePanel();

      }

       

      this.onClickRightArrow = function()

      {

          //console.log('onClickRightArrow');

       

          if( this.activePanel < this.panelCount )

          {

              this.activePanel++;

          }else{

              this.activePanel = 1;

          }

          this.changePanel();

      }

       

       

       

      thanks.

      sorry for pasting all the code.