Hello and thanks for your reply.
Sorry, but you dont understand what i want.
Imagine i want to create ten frame each with a different name, ex:
Lua Code:
for i=0,10 do
_G["ImagineTestFrame"..i] = CreateFrame("Frame","ImagineTestFrame"..i,UIPanelButtonTemplate)
end
All good, no problem !
I have ImagineTestFrame0, ImagineTestFrame1, ImagineTestFrame2, ImagineTestFrame3 ...
If I want to use class, i can this, ex :
Lua Code:
Imagine = CreateFrame("Frame",Imagine,UIParent)
Imagine.TestFrame0 = CreateFrame("Frame",Imagine.TestFrame0,UIParent)
Imagine.TestFrame1 = CreateFrame("Frame",Imagine.TestFrame1,UIParent)
Imagine.TestFrame2 = CreateFrame("Frame",Imagine.TestFrame2,UIParent)
Imagine.TestFrame3 = CreateFrame("Frame",Imagine.TestFrame3,UIParent)
All good, i have Imagine.TestFrame0,Imagine.TestFrame1,Imagine.TestFrame2,Imagine.TestFrame3
But if i want use my for function to automatical create lots of TestFrame with class system, how can i do ?
For exemple what i want and not work :'( :
Lua Code:
Imagine = CreateFrame("Frame",Imagine,UIParent)
for i=0,10 do
Imagine._G["TestFrame"..i] = CreateFrame("Frame",Imagine._G["TestFrame"..i],UIParent)
end
I have "attempt to index field '_G' (a nil value)" error.
Thank for your help.