A. When two actions by the same subject occur simultaneously it is usually possible to express one of them by a present participle. The participle can be before or after the finite verb.
e.g. He rode away. He whistled as he went. = He rode away whistling.
B. When one action is immediately followed by another by the same subject the first action can often be expressed by a present participle. The participle must be put first.