1 Reply Latest reply on May 30, 2018 8:46 AM by liuzhenyilzhy

    expression error:property or method named in class array is missing or does not exist.

    liuzhenyilzhy Level 1

      biaodashicuowu.PNG

      hi,my friends,

      I from china,

      it is unfortunately,my english is poor.

      so,there are many mistake in this post.

      like this,words or grammar is wrong.

      I am sorry.

      I meet an expression error:property or method named in class array is missing or does not exist.

      It saids:

      =================================

      after effects warning:

      expression disabled.

      error at line 35 in porperty 'source text' of layer 1(bfs) in comp 'biaodashibenfen 2'.

      property or method named '0' in class 'array' is missing or does not exist.

      it may have been renamed,moved,deleted,or the name may have been mistyped.

      ==================================

      please look the picture.

      expression is below the==============

      ==============

      l=thisComp.layer("peilai");

      ain=0;

      bout=100;

      p=l.transform.position;

      c=bout-ain;

      dqz=time/thisComp.frameDuration;

      ps=[];

      mzjls=[];

      dqjls=[];

      bfs=[];

          if(dqz<ain){

          idq=0;

      }

      if(dqz>bout){

          idq=0;

      }

      else{

      idq=dqz-ain;

      for (i=0; i<=c; i++) {

          d=(ain+i)*thisComp.frameDuration;

          ps[i]=p.valueAtTime(d);

          if(i>=1){

          mzjls[i]=length(ps[i-1], ps[i]);

          dqjls[i]=dqjls[i-1]+mzjls[i];

      }

      else{

          mzjls[i]=0;

          dqjls[i]=0;

      }

      }

      for (i=0; i<=c; i++) {

          bfs[i]=100*(dqjls[i]/dqjls[c]);

      }

      }

      bfs[idq].toString();

      ===========================

      the line 35 :

      bfs[idq]

      maybe is wrong.

      But I dont know why is wrong?

      How can I fix it?

      Thanks a lot!

        • 1. Re: expression error:property or method named in class array is missing or does not exist.
          liuzhenyilzhy Level 1

          l=thisComp.layer("peilai");//layer

          ain=0;//inpoint frame

          bout=100;//outpoint frame

          p=l.transform.position;//porperty is position

          c=bout-ain;//duration

          dqz=time/thisComp.frameDuration;//current frame

          ps=[];//points set or called array

          mzjls=[];//distance of two near point:length(ps[i-1], ps[i])

          dqjls=[];//the length in this path of current point and starting point

          bfs=[];//the percentage of (the length in this path of current point and starting point) div (the length of the whole path)  set

              if(dqz<ain){

              idq=0;//idq is index of current frame in the set

          }

          if(dqz>bout){

              idq=0;

          }

          else{

          idq=dqz-ain;//idq is index of current frame in the set

          for (i=0; i<=c; i++) {

              d=(ain+i)*thisComp.frameDuration;// the time of current frame

              ps[i]=p.valueAtTime(d);//value of position in current frame

              if(i>=1){

              mzjls[i]=length(ps[i-1], ps[i]);//distance of two near point:length(ps[i-1], ps[i])

              dqjls[i]=dqjls[i-1]+mzjls[i];//the length in this path of current point and starting point

          }

          else{

              mzjls[i]=0;

              dqjls[i]=0;

          }

          }

          for (i=0; i<=c; i++) {

              bfs[i]=100*(dqjls[i]/dqjls[c]);//the percentage of (the length in this path of current point and starting point) div (the length of the whole path)

          }

          }

          bfs[idq].toString();//the percentage of current frame