Frame:UnregisterAllEvents

From Warcraft Wiki
Jump to navigation Jump to search

Unregisters all events from the frame.

Frame:UnregisterAllEvents()

Example

This can be used in conjunction with Frame:RegisterEvent.

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)