With no layers selected, select the pen tool. To the right of the toolbox click on fill and set it to none. Set stroke width to 10px to start with.
Draw a path with the pen tool to create a shape layer.
Twirl down: Shape layer > Contents > Shape 1 > Path 1 > Stroke 1.
Set line cap to Round Cap
Click the + next to the Dashes property - twice.
Set the Dash to 0 px
Set the Gap to 100px.
Adjust stroke width to traste
Animate the offset property to create your 'flow' as required
It won't be infinite - but it can animate for the length of your video : )
If you choose to make a dotted line using Mike's suggestion you can make the offset animate automatically by holding down the Alt/Option key, clicking the stopwatch and then entering this expression:
s = 500; // speed of movement
time * s
If the dots go the wrong way make s = -500
To make the line move faster or slower just change the value of s.
Thank you very much, it worked very well
Or you can also apply this expression:
loopOut(type = "cycle", numKeyframes = 0)
loopOut() the same thing as loopOut("cycle" numKeyframes=0) will only work if the position of the dots is perfectly lined up with the keyframes so you don't end up with a jump. IOW if the dots are moving in x and dot number #1 is at 200 when the animation starts then dot #3 has to be exactly at 200 pixels when the second keyframe is set. There is no foolproof mathematical way to do this so you have to adjust the position of the keyframes manually until the loop does not jump. You could use loopOut("offset") and then adjust the speed by sliding the second keyframe. That is an easy way to use loopOut().