View Single Post
02-18-11, 01:05 PM   #11
yssaril
A Warpwood Thunder Caller
 
yssaril's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2007
Posts: 96
Code:
LeftScrollBar.scrollChild.button = CreateFrame('button', "HHeaderButton" .. bnid, LeftScrollBar.scrollChild)
the above code always sets the reference to your button to LeftScrollBar.scrollChild.button as such the reference is overwritten each time through the loop.

You should do something like this

Code:
LeftScrollBar.scrollChild.button[bnid] = CreateFrame('button', "HHeaderButton" .. bnid, LeftScrollBar.scrollChild)
that way you always have a reference to it via LeftScrollBar.scrollChild.button[i] (where i equals 1 through n)
  Reply With Quote