I personally don't think you can use alpha on text. If you convert the text to an image, you could do this. If it works with text, great. I'm sure it won't though...
HTML Code:
//#CLIENTSIDE
function onCreated(){
this.dontblock();
//So I set the image at the start - no need to keep re-drawing it.
this.fimg = findimg(200);
with(this.fimg) {
x = screenwidth / 2;
y = screenheight / 2 - 180;
image = "block.png";
alpha = 0;
layer = 4;
zoom = 2;
}
this.onTimeout();
}
function onPlayerEnters() {
this.onCreated();
}
function onTimeout(){
this.onCheckScreen();
setTimer(0.05);
}
function onCheckScreen() {
if (player.x in |this.x-10,this.x+10| && player.y in |this.y-5,this.y+5|) {
//If the image alpha is less than one, increase it gradually.
if (this.fimg.alpha < 1)
this.fimg.alpha += 0.05;
} else {
//If they're not in the area and the alpha is greater than 0, decrease it gradually.
if (this.fimg.alpha > 0)
this.fimg.alpha -= 0.05;
}
}