timer++;

switch(state)
{
    case 0:
        alpha = timer / fade_in_time;
        if timer >= fade_in_time
		{
            state = 1;
			timer = 0;
		}
        break;
        
    case 1:
		alpha = 1.0;
        if !is_undefined(_callback)
            _callback();
        state = 2;
        break;
		
	case 2:
		alpha = 1.0;
		if timer >= stay_time
		{
			state = 3;
			timer = 0;
		}
		break;
        
    case 3:
        alpha = 1 - timer / fade_out_time;
        if timer >= fade_out_time
            instance_destroy();
        break;
}