See, in the scene, the top of the flag ends and becomes transparent at a different point then the bottom. I want the end to be straight, not slanted like I have now.
Connecting different socket types is generally a bad idea. In this case you have the Object coordinates (a Vector - as indicated by the blue socket) connected to the scalar Value input of a Multiply Math node. This will automatically convert from the vector into a scalar (ie, a plain number) by averaging each of the X,Y,Z values of the vector together - not what you want. Instead, replace the Multiply node with a Separate XYZ node and then use whichever of the X, Y, Z outputs matches your requirements (probably X as indicated in the comments).
Looks as if it might be doing something weird with the color ramp. It's going diagonal instead of left to right.
Edit: You need a gradient texture right after the mapping node to convert to color.