Adding/Removing a scriptUI Group
Here's my code:
dropSelec.onChange = function secOff()
{
if (dropSelec.selection==3)
{
if (offGroupMain.children.length==1)
{
var offGroupT=offGroupMain.add("group");
var secOffOne = offGroupT.add ("statictext", undefined, "Offset Two:");
var secOffTwo = offGroupT.add ("edittext");
secOffTwo.characters = 5;
secOffTwo.text="1";
var secOffThree = offGroupT.add ("statictext", undefined, "frames");
win.layout.layout(true);
}
}
if (dropSelec.selection!==3)
{
if (offGroupMain.children.length>1)
{
offGroupMain.remove(offGroupT);
win.layout.layout(true);
}
}
}
I'm trying to make it so that when my drop down menu is on a certain selection, it creates a new line in the UI, and removes it when changed to anything else.
Right now it is both adding and removing the line when I switch to the specified selection.