Creating and animating cigarette lighter flame

Start by opening an image of a lighter.

Create a selection using polygon lasso tool as shown. Press Ctrl+J to copy paste the selection in a new layer.

Hide the top layer. Clone the area in the layer below using clone stamp tool.
Create a flame shape using pen tool and place as shown.
Double click the layer to open layer style window. Apply settings as shown.

From layer menu select layer style>>create layers. Select and merge all the resulting layers. Change the layer mode to linear dodge.

Duplicate this layer twice. Press Ctrl+T. Right Click and select Warp. Adjust the nodes to get two slightly different shapes as shown.
For starting of the flame create two small shapes as shown.

Open animation window. For the first frame hide all the flame layers.
Duplicate frame. Move the switch layer a pixels downwards. Unhide the smallest flame layer.
Select both the frames. Duplicate twice.
Select the 6th frame. Hide the smallest flame layer and unhide the little bigger flame.
Duplicate the last frame. Keep unhiding the full flame layer (three in all) with each duplicate.
Select last three frames. Duplicate a number of times as long as you want the flame to be up.
Press Ctrl+Alt+Shift+S to save an optimized animated GIF.