In the Revised 2001 "YOUR FLAG" from the Boy Scouts of America on page 33 it states:
"When in uniform, with your head covered or uncovered, either indoors or outdoors, stand at attention and salute with your right hand when
The national anthem is played.
The colors are raised or lowered.
Reciting of the Pledge of Allegiance.
The flag passes by in a parade or review.
A flag-draped coffin is passing.
"Taps" is sounded at a funeral.
United States Code - Title 4 - Flag and Seal, seat of Government, and the States - Chapter 1 - The Flag - Section 4 Pledge of allegiance to the