The bats flew wildly near the full moon so they could scare the children before morning came.
The subject of this sentence is the bats.
The predicate of this sentence is flew.
The where detail is near the full moon. The how detail is wildly. The why detail is so they could scare the children. The when detail is before morning came.