2 Replies Latest reply on Nov 24, 2014 8:05 PM by wendan

    Animate the drawing of a line across the screen


      I currently use Flash CS5. I am attempting to demonstrate the flow of control oil through a series of hydraulic actuating valves. I want to have a thin, black line (stroke--1 pt) representing the oil “draw itself” across the screen. The line will extend in a convoluted path horizontally and vertically through a series of valves before terminating in a servo cylinder.


      I can make this work using a shape tween, but to extend or draw the line, I have to make two copies of the line (a short line and then a longer line). And I have to do this every time the line changes direction—every time it turns horizontally or vertically.


      Is there is a more efficient way of doing this?



        • 1. Re: Animate the drawing of a line across the screen
          robdillon Most Valuable Participant

          Without seeing the line that you are animating, it's difficult to know what might be simpler. The only method that comes to mind is to use a mask. Draw the complete line and then use a mask to show only the part of the line that you want at any given point. It may be simpler to animate the mask than the actual line.

          1 person found this helpful
          • 2. Re: Animate the drawing of a line across the screen
            wendan Level 1

            Thanks for your response.


            Imagine a single line being drawn across the screen. The line will be drawn horizontally and them go vertically across the screen as it moves through various valves just as control oil would move through a pipe. That's what I am replicating.


            I thought I could charge the properties of the line. The line starts as these X/Y coordinates and the end of the line moves to this X coordinate, then moves to this Y coordinate, etc. and in doing so, the line grows. Perhaps this can be done in actionscript. I will experiment.


            Thanks again for the reply.