0

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!

by
2 Replies
  • Create a TextButton and set the label = '', then just appendTo() an image that sits inside the TextButton.
    0
  • 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 :

    CODE
    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: {
    onSelect:function(event){
    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;
    }
    }
    self.grabXML(self.config.Feed);
    }
    }
    }).appendTo(this.controls.imageTest);



    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.
    0

Recent Posts

in Getting Started / Beginners - Yahoo! TV Widgets