3 Replies Latest reply on Sep 2, 2006 11:23 PM by mirianam

    Using Library Rotation(time-based) how to go to frame after 20 seconds

    mirianam Level 1
      I am using the Rotation (time-based) behaviour from the library.
      Another sprite starts and stops the "minute hand" which rotates 360 degrees in 20 seconds for a "clock" sprite which starts and stops(&rewinds) a flash video sprite.
      How do I modify the code of the "Rotation(time-based) behaviour" so that when it reaches 360 degrees (or 20 seconds) I can go to another frame of the movie?

      Can anyone please give me guidance - I just can't make any headway - any help would be be very appreciated.
      Thanks
      mm
        • 1. Re: Using Library Rotation(time-based) how to go to frame after 20 seconds
          Level 7
          On Sat, 02 Sep 2006 10:46:31 GMT, mirianam posted in
          macromedia.director.lingo:

          > How do I modify the code of the "Rotation(time-based) behaviour" so
          > that when it reaches 360 degrees (or 20 seconds) I can go to another
          > frame of the movie?

          I only have the D8.5.1 version to look at, but if it's the same as the
          current version, you can monitor the behavior's myTicksLeft property. Just as
          a test, I created the following behavior and dropped it on the same sprite
          with the Rotation(time-based) behavior.

          on exitFrame me
          if sprite(me.spriteNum).myTicksLeft = 0 then
          go the frame + 1
          end if
          end

          I only quickly scanned the behavior's comments, though. It's possible that
          the author provided a method to do this without directly accessing the
          properties.



          --
          Mark A. Boyd
          Keep-On-Learnin' :)
          • 2. Re: Using Library Rotation(time-based) how to go to frame after 20 seconds
            Level 7
            If you only want this behavior to work for one full rotation of the
            sprite then you can do this:

            add a property to listing at the top of the behavior.

            property startingTicks

            then in the on initialize me function add this as the last line:


            startingTicks = myTicks + myRotationTime

            then in the on Turn me function add this as the last line:

            if startingTicks > the ticks then go to "new marker name"

            where "new marker name" is the name of the marker that you want to jump
            to.

            --
            Rob
            _______
            Rob Dillon
            Adobe Community Expert
            http://www.ddg-designs.com
            412-243-9119

            http://www.macromedia.com/software/trial/
            • 3. Re: Using Library Rotation(time-based) how to go to frame after 20 seconds
              mirianam Level 1
              Thank you so very very much - you put me in the right direction.
              As I have another sprite which actually starts the rotation I have used the following code and it works as I need it to.

              on exitFrame me
              if sprite(me.spriteNum).rotation = 360 then
              go to "well_done"
              end if
              end

              I didn't realize that I could add another behaviour to the "minute" sprite and that it would be able to get the information from the "Rotation(time-based) behaviour. I must have tried putting this code everywhere except onto the "minute" sprite.

              I tried modifying the rotation behaviour but it didn't work for me - will see if I can get it to work.

              Thank you again

              Miriana