Based on your code from a previous post:
function myScript(thisObj){
function myScript_buildUI(thisObj){
var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "myScript", undefined, {resizeable:true});
if(myPanel != null){
var res = "group {orientation:'column',\
grp1: Group {orientation:'row',\
RadioButton1: RadioButton{text:'1'},\
RadioButton2: RadioButton{text:'2'},\
},\
grp2: Group {\
finalButton: Button{text:'Make a PIP'}\
}\
}";
myPanel.grp = myPanel.add(res);
myPanel.layout.layout(true);
myPanel.grp.minimumSize = myPanel.grp.size;
myPanel.layout.resize();
myPanel.onResizing = myPanel.onResize = function () {this.layout.resize();}
// when finalButton is clicked, call makePIP() and pass the values of RadioButton1 and RadioButton2 from the UI as parameters.
myPanel.grp.grp2.finalButton.onClick = function () { makePIP(myPanel.grp.grp1.RadioButton1.value, myPanel.grp.grp1.RadioButton2.value);}
return myPanel;
}
}
var myPal = myScript_buildUI(thisObj);
if(myPal != null){
if(myPal instanceof Window){
myPal.center();
myPal.show();
}
}
}
function makePIP(r1, r2) {
// r1 is the value of RadioButton1 in the UI; r2 is the value of RadioButton2.
// what this button actually does depends on which value is true.
if (r1) alert("Radio button 1!");
if (r2) alert("Radio button 2!");
}
myScript(this);
Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive | RenderBreak [blog] | Profile [LinkedIn]