I think nearly every parent has this problem with children from time to time. When my two children were young, I thought that I found a very simple solution to it.
Whenever one or the other would start acting up at inappropriate times, I would just take them by the hand, put them in the back yard and tell them that they couldn't come back in the house till they settled down. This solution worked every time, in only a few minutes and was particularly effective when it was very cold outside.
One day my son came home with a pack of cigarettes. I told him that he was going to have to help us move his bedroom furniture into the garage because if he smoked, he wouldn't be allowed to sleep in the house. That nipped the smoking thing in the bud. He turned 40 this year and still doesn't smoke.
I think you have to use your wits with kids. Loosing your temper, scolding or corporal punishment is the worst action that you can take.
regards