Hello,
I have been working on writing a script that will allow me to store all of the names of buttons in an array. With code like this.
var spellTextureArray:Array = new Array(
spellTexture0,
spellTexture1,
spellTexture2,
spellTexture3);
Then I try and do a for loop to iterate through the creation of the buttons like this.
for(var j:int = 0; j < spellArray.length; j++)
{
if (spellArray[j].Contains(Event.current.mousePosition))
{
if (GUI.RepeatButton(Rect(spellArray[j]), spellTextureArray[j]) && mdown == false)
{
mdown = true;
//print("spell " + j + " mouse is down");
}
else
{
mdown = false;
//print("spell " + j + " mouse is up");
}
}
else
{
GUI.RepeatButton(Rect(spellArray[j]), spellTextureArray[j]);
}
}
The textures names are not passing to the GUI.RepeatButton operation. I can hard code the name and the texture shows up, so I know the texture is linked. Is there something obvious that I am missing? This has me pretty stumped.
Best Regards,
Steve