Related to a similar rule for sailing ships, it is considered bad luck for an actor to whistle on or off stage.

Today it's called a "theatrical superstition". However, every superstition has a historical background. As original stage crews were hired from ships in port (theatrical rigging has its origins in sailing rigging), sailors, and by extension theatrical riggers, used coded whistles to communicate scene changes. Actors who whistled would confuse them into changing the set or scenery and could result in injury or death. In today's theatres, the stage crew normally uses an intercom or cue light system.

Well, I guess screen actors and actresses can whistle whenever they want!

More Info: