I am just trying to make a transparent button in the smartface cloud IDE using java script, and every time I make it transparent it wont read a click. I can increase the opacity all the way to alpha = .1 but when I set it equal to zero it wont work. How can I fix this, or is there another way to do this. I just want the button to take this form...
left : "50%", top : "50%", height : "50%", width : "50%", (The bottom right hand corner)
This is the code I have for the button (It doesn't work)
var myTextBtn = new SMF.UI.TextButton({
left : '50%',
top : '50%',
width : '50%',
height : '50%',
text : "",
onPressed : alert("Pressed"),
});
myTextBtn.alpha = 0;
page1.add(myTextBtn);
alphashouldn't affect click unless it is0. The problem isonPressedaccepts callback function. But you are callingalertfunction there and giving its result toonPressedproperty.Try this: