0

Disabling buttons

I have a row of TextButton buttons numbered incrementally. When a certain condition is meant, I want to disable several buttons from being focused/clicked. I've successfully disabled other controls in the past but am stuck here.

I'm using the code:
CODE
for(var nona=1; nona<5; nona++){
this.controls['nav'+nona+'_btn'].enabled=false;
print('>>>'+this.controls['nav'+nona+'_btn'].enabled);
}


As expected, the code prints false 4 times. If I trace the buttons themselves, the correct control is listed. However, the buttons continue to accept focus and selection. I have tied this code in both the updateView and focusView functions without success. What am I doing wrong?

by
1 Reply
  • Sorry everyone. I found the answer in the KONTX docs (of course). For future reference, the proper procedure is:

    CODE
    for(var nona=1; nona<5; nona++){
    this.controls['nav'+nona+'_btn'].setDisabled(true);
    }


    This is because controls.TextButton inherits from controls.Button which inherits from element.Button.
    0

Recent Posts

in Getting Started / Beginners - Yahoo! TV Widgets