You should try running the debug version of flashplayer when testing, it makes sorting this kind of thing out much easier..
When I run your code it's as Wilbert suggest I get an error that outcheck1 is not definded
If you want to access variables outside of the function you just declare (create) them before the function
Code:import km.core.*; import km.components.*; var outcheck1:String var outcheck2:String var outcheck3:String checkbox1.setProperties({x:50, y:50, checked:false}); checkbox1.text = 'Checkbox 1'; checkbox1.onChange = function(){ outcheck1 = this.checked ? 'checkbox 1 checked' : 'checkbox 1 unchecked'; txt2.text = outcheck1; } addChild(checkbox1) checkbox2.setProperties({x:50, y:70, checked:false}); checkbox2.text = 'Checkbox 2'; checkbox2.onChange = function(){ outcheck2 = this.checked ? 'checkbox 2 checked' : 'checkbox 2 unchecked'; txt2.text = outcheck2; } addChild(checkbox2) checkbox3.setProperties({x:50, y:90, checked:false}); checkbox3.text = 'Checkbox 3'; checkbox3.onChange = function(){ outcheck3 = this.checked ? 'checkbox 3 checked' : 'checkbox 3 unchecked'; txt2.text = outcheck3; } addChild(checkbox3) // output checkbox combinations pushbutton1.addEventListener(MouseEvent.MOUSE_DOWN ,outputshow); function outputshow(e:MouseEvent):void { var result:String = outcheck1 + outcheck2 + outcheck3; txt1.text = result; }




Reply With Quote