Image Button

Hi guys, I would like to ask if there is anyway you can set an image inside a button and change its opacity level. The button should work like a Text Button just that it has image instead of text in it. Anybody got any idea?

Thanks in advance!

2 Replies
  • Create a TextButton and set the label = '', then just appendTo() an image that sits inside the TextButton.
  • Hi thanks for the reply. Sorry if i m a bit slow, but what do you mean by sit inside the TextButton? I did the following below :

    this.controls.imageTest = new KONtx.element.Image({
    src: 'image/Roadwork.png',
    styles: {
    'hAlign': 'top',
    'vAlign': 'left',
    width: 710,
    height: 550

    this.controls.nextRecord = new KONtx.control.TextButton({
    label: 'Next',
    styles: {
    width: 294,
    height: 40,
    vOffset: 500,
    backgroundColor: 'black',
    fontSize: KONtx.utility.scale(50),
    zOrder: 2
    }, //Style information for the Button stored in our 960x540.js file
    events: {
    self.controls.previousRecord.disabled = false;
    self.controls.previousRecord.visible = true;
    if(self.config.indexSelected < self.persist.title.length - 1){
    self.config.indexSelected += 1;
    self.config.isLocationChanged = true;
    if(self.config.indexSelected == self.persist.title.length - 1){
    this.disable = true;
    this.visible = false;
    //self.controls.previousRecord.focus = true;

    I tried appending the button to the image and image to button but both ways doesn seems to be working. Is there any other way?
    Thanks in advance.

Recent Posts

in Getting Started / Beginners - Yahoo! TV Widgets