Why in this section my .color is not recognized as beeing a member of GUIElement ?
function fade(direction:boolean){
var alpha;
if (direction){
if (guiElement.color.a < 0.5){
timeLeft = timeLeft - Time.deltaTime;
alpha = (timeLeft/fadeDuration);
guiElement.color.a=0.5-(alpha/2);
} else {
timeLeft = fadeDuration;
}
} else {
if (guiElement.color.a > 0){
timeLeft = timeLeft - Time.deltaTime;
alpha = (timeLeft/fadeDuration);
guiElement.color.a=alpha/2;
} else {
timeLeft = fadeDuration;
}
}
}