Animating a flag in text

In this tutorial, we'll unite Britain and the United States, in this case, we'll have the US flag highlighted within the words Britain, with the flag giving an animated waving effect. Start by opening an image of the US flag.

Select horizontal type mask tool.
Type the respective country name.

Press Ctrl+Shift+I and fill the selection with white color in a new layer.
Double click the layer to open layer style window. Apply layer style with the settings shown.
Hide the hollow text layer. Select the flag layer. Duplicate. Press Ctrl+T. Right click the layer and select warp. Adjust nodes to get the shape as shown.

Similarly duplicate the layer and warp again to create some distortion.

Open animation window. For the first frame unhide the hollow text layer. Keep the original flag layer visible and hide the duplicates.
Duplicate frame. Hide the original flag layer and unhide the first duplicate.
Duplicate frame. Unhide the next duplicate.
Press Ctrl+Alt+Shift+S to save an optimized animated GIF.