2 Replies Latest reply on Nov 9, 2010 6:28 AM by Anthony Blackman

    Interactive animation issues

    Anthony Blackman

      I know its simple, but I want a named sprite (titled: "navigation small") to blend from 0 to 100 when the mouse rolls over a different sprite (named: "Compass") in a seperate location on the screen.

      I'm new to the program, and programming in general, and so would really appreciate some advice on how to code the above.

      Many thanks.

        • 1. Re: Interactive animation issues

          attach a script to the compass sprite with this in it. (this script needs to run each frame)


          on mouseWithin -- see mouseWithin in the director help for more information


            tSprite = sprite("navigation small"")

            tBlend = tSprite.blend

            if tBlend < 100 then

              tBlend = tBlend + 10  -- change 10 if you want the animation faster or slower

              if tBlend > 100 then

                tBlend = 100

             end if

              tSprite.blend = tBlend

            end if




          Although it's more advanced it's better programing to tell a script attached to the "navigation small" sprite to change it's blend than to do it like this from another location. I can help you with that if you want to. (Doing it like this can make it harder to debug since you might not remember that the sprite is influenced from another script at the time.)

          1 person found this helpful
          • 2. Re: Interactive animation issues
            Anthony Blackman Level 1

            Thank you very much for your help.

            I found that it was easier to quote a sprite channel number rather than a sprite name so that the script could be used on more that one occasion throughout the movie - providing, of course, that the sprite to appear was positioned in the same channel every time the script was needed.

            Thanks again.