API Frame SetScript

Sets the action handler for this frame.

frame:SetScript("handler", function)

Arguments

 * ("handler", func)


 * handler : String - The handler to attach func to (OnShow, OnEvent, et al)
 * func : Function - The function to call. nil to remove the handler.

Arguments for func:
 * If func is a global function (function MyGlobalFunc), it'll be called with arguments (frame, arg1, arg2, ...) (event being arg1 for OnEvent handlers)
 * If func is an object method (function MyAddOn:MyMethod</tt>), it'll be called with arguments (arg1, arg2, ...)</tt> (the frame won't be passed)

Example
for i = 1, 4 do    local frame = getglobal("PartyMemberFrame"..i)     frame:SetScript("OnShow", frame.Hide) end

Result
All party frames will be hidden whenever they're shown.

PartyMemberFrame1:SetScript("OnShow", nil)

Result
Removes the OnShow handler from PartyMemberFrame1.