View Single Post
05-03-08, 02:58 PM   #7
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
Originally Posted by Everglow View Post
1. How can I store global frames in a table in such a way as to run its methods?
it would be simply

Code:
local frames = {}
for i = 1,7 do
   frames[i] = getglobal("ChatFrame"..i)
end
or


Code:
local frames = {}
local g = getfenv(0)
for i = 1, 7 do 
   frames[i] = g["ChatFrame"..i]
end
I think the second method is moderately faster.

Then to say hide the frame do.

Code:
 frames.1:Hide()
or to hide all of them

Code:
 for i,v in ipairs(frames) do
   v:Hide()
end
2. Is there a way to copy a method to a local using the global environment?

http://www.wowwiki.com/index.php?tit...pt&action=edit

:GetScript("handle")
  Reply With Quote