Goodgulf:
To throw some oil on the fire, according to the Little Brown Handbook:
Tom said: "You need a spanking."
is also correct.
Yes, colon before quoted speech is a valid alternative to a comma.
Alef:
To take this to a higher level, I might mention that in 2008 "The Language Council of Norway" changed correct usage from
"I don't want a spanking," Mary said
to
"I don't want a spanking", Mary said.
So for us Norwegians it is not a question of full stop or comma, but of where to put the comma! Of course, nobody follows the new rule, not even the few that have heard about it.
To make matters more interesting, exclamation marks and quotation marks still belong inside the quotes:
"I don't want a spanking!" Mary said.
and
"I don't want a spanking?" Mary asked.
It's generally accepted that the final punctuation of the quoted speech - comma, question mark or exclamation mark - belongs inside the inverted commas. Interesting that the Norwegian Language Council is trying to change that as regards the comma. Have they said why?
Further complication: if you're quoting a complete, separate sentence, the full stop goes inside the inverted commas; but if only part of it, preceded by narrative, it goes outside. So:
Tom glared at Mary. "You need a spanking."
but
Tom glared at Mary and told her that "she needed a spanking".
This is often disregarded, though.