Help with ViewStack
I have a titlewindow with 2 buttons. And within the titlewindow there is a viewstack. The viewstack have 2 containers. Button1 click event to switch to container1 and button2 click event to switch to container2. Each container have its own control. Container 1 have textinput and vslider. Container 2 also have textinput and vslider. I could retrieve and set the values of controls in container 1 when button1 is click using viewstack.selectedIndex=0. but am unable to set the values of the control in container 2 when button2 is clicked using viewstack.selectedIndex=1. Got this error for container2.
Error #1009: Cannot access a property or method of a null object reference.
Appreciate if you could kindly advise.
if(DB.variableView == "Cont1")
varEditor.toggleBtn1.selectedIndex = 0;
varEditor.viewstack1.selectedIndex = 0;
varEditor.txtInitialValue1.text = DB.varInitialValue;
if(DB.variableView == "Cont2")
varEditor.toggleBtn1.selectedIndex = 1;
varEditor.viewstack1.selectedIndex = 1;
varEditor.txtInitialValue2.text = DB.varInitialValue;