Thread Tools Display Modes
Prev Previous Post   Next Post Next
10-26-23, 06:14 PM   #1
dragonflyy
An Aku'mai Servant
 
dragonflyy's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 32
Getting a frame through global

I have been away from WoW for 2 years, just started playing again and wanted to update an old addon I had made. However, I am running into a problem. I need to get each of the party frames, but the method I've used before is not working.

If I manually grab the frames:
Code:
PartyFrame.MemberFrame1
then it returns a table and I can hide/show that frame no problem.

Once I try to add it to a variable, it comes up nil. The way I've done this in the past was:
Code:
local frame = _G["PartyFrame.MemberFrame1"]
This returns nil, using just _G["PartyFrame"] does give me the PartyFrame, but I can't get the MemberFrames individually. The reason I used this method was a for loop:
Code:
for i=1, 4 do
  frame = _G["PartyFrame.MemberFrame" .. i]
end
This used to work (2 years ago) but now it's nil. Did the _G change, or am I just missing something obvious here?

Tried searching around on the internet but can't seem to find a change.
  Reply With Quote
 

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Getting a frame through global


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off