The circuit we need to make the flagwaver wave its flag is a basic solar engine. More specific a 1381 - based solar engine.
Most small solar cells aren't able to make a motor spin when connected directly to it. So we need to store all the energy of the solar cell until there is enough for the motor to run. Thats where we need the capacitor for. Slowly it fills up until it reaches the desired voltage. The 1381 - voltage supervisor IC trips when the voltage meets the desired level and it puts the voltage to the base of the 2N3904 transistor. That opens the gates for the current to go through the motor and so the motor spins. At the same time the 2N3906 is opened. This allows the current to pass around the 1381 so that the capacitor can be fully drained. Otherwise the 1381 would shut down the circuit it the voltage drops below its trip - point.
Result: The flagwaver will come alive with little bursts of energy an it will wave its flag happely ever after.