API Frame UnregisterAllEvents

Unregisters all events from the frame.
 Frame:UnregisterAllEvents()
==Example==
This can be used in conjunction with .
local function OnEvent(self, event, ...)
	print(event, ...)
end
local f = CreateFrame("Frame")
f:RegisterEvent("PLAYER_STARTED_MOVING")
f:RegisterEvent("PLAYER_STOPPED_MOVING")
f:UnregisterAllEvents()
f:SetScript("OnEvent", OnEvent)