hi , guys.
I am a new learner studying XSI coding . currently I am going to do a custom UI for my own script which need PPG knowledge.
My script wrote like this
////////////////////////
var myPset=ActiveSceneRoot.AddProperty(“CustomProperty”,false,“Mytest”);
var myLayout=myPset.PPGLayout;
var b=1;
myLayout.AddRow()
myLayout.AddButton(“a”,“button”);
myLayout.Logic=a_OnClicked.toString();
myLayout.EndRow()
myLayout.Language = “JScript” ;
InspectObj(myPset);
function a_OnClicked(){
LogMessage(b);
}
/////////////////////
this is a very simple test coding , I dont know why my button function can not read variable “b” . very times when I run this script ,it always failed and show "b is not defined " .
I dont understand that I already defined var b=1 at the very beginning , how com the function can not visit it ?
anything wrong I did ? hope somebody help me :love: