View Single Post
01-16-15, 10:47 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
I do something like this sometimes:
Lua Code:
  1. local myFrame = CreateFrame("Frame", nil, UIParent)  --this frame has no global name, only a local reference
  2. myFrame.label = myFrame:CreateFontString(......)
Then, if that child will be accessed more than once, I'll assign it to a local variable for faster lookups.
Lua Code:
  1. local myLabel = myFrame.label
  2. myLabel:SetPoint("CENTER")
  3. myLabel:SetText("Some text.")
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote