3 Replies Latest reply on Feb 5, 2016 12:18 PM by joel_pau

    get current time lable

    ryan_pu Level 1

      So I can play to

      .play('label')

       

      And I can stop at

      .stop('label')

       

      but How do I read what label I am currently at? I would like to make some conditionals based off where it is in timeline based on labels.

        • 1. Re: get current time lable
          joel_pau Level 5

          Hi,

           

          You have 2 tools: sym.getPosition() and sym.getLabelPosition().

          I assume i have a label called "first" at 1000 (one second);

          if ( sym.getPosition() ==  sym.getLabelPosition("first") ) { console.log("the current label is first) };

          What's your goal?

          • 2. Re: get current time lable
            ryan_pu Level 1

            Would like to attach a list of switches to a tester and compare them to a results list. if its a match, activate another function.

             

            example:

            conditionsArray(['.btn1','.swtch1']);

            if (conditionsArray == on, on) {startEngine}

             

             

             

            code that I got so far:

             

            function twoPhaseSwitch(object,state)

            {

              var obj = $(object);

              var state = $(state);

             

              obj.click(function(e)

              {

              if(state == 'off')

              {

              stage.getSymbol(obj).stop('on');

              state = 'on';

              }else{

              stage.getSymbol(obj).stop('off');

              state = 'off';

              }

              });

             

             

            };

             

             

            function conditionsArray(obj)

            {

              for (var i=obj.length;i--;)

              {

               //alert(obj.getPosition());

               //alert(obj.state);

               //alert(obj[state]);

              }

            };

            • 3. Re: get current time lable
              joel_pau Level 5

              Well, i have Edge Animate 1.5

              Can you send me a sample using a private message?