3 Replies Latest reply on Nov 27, 2011 11:41 AM by tyree_2

    play thru

    tyree_2 Level 2

      Im trying to get an animation to play frame by frame by keydown. the problem is, it only plays the first two frames and doesnt increment to the last frame 



      on keyDown

        if (_key.key = "p") then


        end if


        if member(1).model("group01").bonesplayer.currenttime<1699 then


        end if 


        • 1. Re: play thru
          Sean_Wilson Adobe Community Professional

          Lingo doesn't use the '+=1' construct that other languages understand, so your if statement might be reconstructed as:

            tCurrentTime = member(1).model("group01").bonesplayer.currenttime
            if tCurrentTime < 1699 then
              member(1).model("group01").bonesplayer.currenttime = tCurrentTime + 1
            end if
          1 person found this helpful
          • 2. Re: play thru
            tyree_2 Level 2

            thanks for that, I was unaware of lingo not using +1 partially because no error was thrown. I havent tried the code yet, but without director throwing an error I had no idea of a syntax problem

            • 3. Re: play thru
              tyree_2 Level 2

              I tried it and that indeed worked, but a side effect happened. I use the arrow keys to control the character position. after using the currentime code, now the arrow keys speed up the animation and cause it to play faster. no engine really supports frame by frame animation. so its not completely surprising it doesnt work properly.


              for whatever reason the current time code is being triggered by the arrow keys. despite being set to the p key