AceEvent-3.0 Documentation

Getting a hold of AceEvent:

local AceEvent = LibStub:GetLibrary("AceEvent-3.0")
local AceEvent = LibStub("AceEvent-3.0")


or the more common use embed AceEvent into your addon object:

local myAddon = LibStub("AceAddon-3.0"):NewAddon("myAddon", "AceEvent-3.0", ... )

or in a random other object/table:

local AceEvent = LibStub("AceEvent-3.0")
local mytable = {}
AceEvent:Embed(mytable)

For the further API documentation we will assume AceEvent embedded into some object.

AceEvent API

addon:RegisterEvent( event[, method[, arg]] )
	event (string) - Blizzard event to register for.
	[method] (string|func) - Method to call when the event is fired. A string method is called like addon[method]( event, [arg, ...] ).
	[arg] - optional argument, if set will be passed as the first argument when the event fires.

addon:UnregisterEvent( event )
	event (string) - Blizzard event to unregister.

addon:UnregisterAllEvents()
	Unregister all events.

addon:RegisterMessage( message[, metod[, arg]] )
	message (string) - Message to register for. 
	[method] (string|func) - Method to call when the message is fired. A string method is called like addon[method]( event, [arg, ...] ).
	[arg] - optional argument, if set will be passed as the first argument when the message fires.
Messages are used for interaddon communication.

addon:SendMessage( message[, ...] )
	message (string) - Message to trigger.
	[...] - optional arguments to the message.
Will fire a message towards all listeners.

addon:UnregisterMessage( message )
	message (string) - Message to unregister

addon:UnregisterAllMessages()
	Unregster all messages.

