1. Take any background as shown in the image :
2. Draw a boatsman like as shown below in a new layer or same layer :
3. Now draw some clouds in a new layer a shown below:
4. Now draw a sun in a separate layer a shown below. If you hide the clouds layer created in step above, you would see the following :
6. Now go to File menu>Save for Web and select the format as Gif, check the checkbox "animate". Check the "loop" checkbox and specify the delay timing. I have mentioned the delay time as 1 second. So this means, my two layers shown above will appear alternatively after a delay of 1 second.
PS : If animation is not visible in the image above , click on the image to open it in the new browser.