I have a straight, gradient line which extends from one end of the screen to the other.
What is the best (or only) approach for screen wrapping this line graphic, so that it appears to be moving?
My current "solution" is to draw the horizontal line at double the width of the screen and duplicate the gradient pattern for each half of the line. The line is center-registered and it's moved toward the right. Once half of the line traverses the stage, the line is reset to it's starting point.
Is there a better way?
Well, the only alternative I can think of is using the drawing API to draw a gradient stroke, calculating the offset in each frame. But it would definitely be more costly than just applying a positional transform on a display object. The tiny bit of arithmetic alone should be enough to make it slower.
Your proposed solution may not seem much elegant, or efficient but as we are running in a VM highly optimized for drawing and transforming occluded vectors and bitmaps (and really undependable on every other optimization) I think the best bet would be to just trust the VM at this point. :)