Give names to your bars.
Lua Code:
local classPower = CreateFrame("Frame", nil, UIParent);
classPower:SetWidth(256);
classPower:SetHeight(36);
classPower:SetPoint("CENTER");
for i = 1, 10 do
local bar = CreateFrame("StatusBar", "ClassPowerBar" .. i, classPower);
bar:SetSize(36, 36);
if i == 1 then
bar:SetPoint("LEFT", classPower, "LEFT");
else
bar:SetPoint("LEFT", classPower[i - 1], "RIGHT", 3, 0);
end
classPower[i] = bar;
end
frame.ClassPower = classPower;
In general, names aren't mandatory, but sometimes, like in this particular case, /fstack is very very picky.
-- edit #1
When you're "nesting" one frame table inside another one like so: frame[1] = anotherFrame, you must give anotherFrame a proper name, it's only needed when you index w/ numbers, if you do something like this: frame["1"] = anotherFrame, you can leave anotherFrame nameless.
Once again, it only applies to "nesting" inside other frames. For example, doing something like this won't cause any issues:
Lua Code:
local classPower = CreateFrame("Frame", nil, UIParent);
classPower:SetWidth(256);
classPower:SetHeight(36);
classPower:SetPoint("CENTER");
local container = {};
for i = 1, 10 do
local bar = CreateFrame("StatusBar", nil, classPower);
bar:SetSize(36, 36);
if i == 1 then
bar:SetPoint("CENTER");
else
bar:SetPoint("LEFT", container[i - 1], "RIGHT", 3, 0);
end
container[i] = bar;
end
frame.ClassPower = container;