Frames without a parent are mostly used for event handling puposes. They need no parent. And if you call frame:GetParent() it wil probably return nothing.
eventHandler
Lua Code:
local eventHandler = CreateFrame("Frame")
eventHandler.OnEvent = function(...)
print(...)
end
eventHandler:SetScript("OnEvent",eventHandler.OnEvent)
eventHandler:RegisterEvent("PLAYER_LOGIN")
timer
Lua Code:
--only runs if frame is shown
local timer = CreateFrame("Frame")
timer.OnUpdate = function(...)
print(...)
end
timer:SetScript("OnUpdate",timer.OnUpdate )
timer:Hide()
--to run the timer you show/hide it OnEvent
If you have a frame that should have an visual impact on the game world it has to be part of UIParent (for the sake of ui scaling alone). Some stuff needs to reside on WorldFrame but that is out of my reach. Semlar could probably tell you more. Of course the parent to UIParent is only needed for the first frame of your stack.
frame stack
Lua Code:
local base = CreateFrame("Frame",nil,UIParent)
local level1 = CreateFrame("Frame",nil,base)
local level2 = CreateFrame("Frame",nil,level1)