Fading alpha in and out

I’ve been trying to create a movie clip that fades the alpha channel down to 10, and then when it gets down to 10, it fades it back to 100. And then continually does that over and over, but I can’t seem to figure it out.

I’m using this code, but I know something is severely wrong with my logic, but I have no idea where I am going wrong :m:


if(this._alpha == 100){
            this._alpha -= 1;
                }
        else if(this._alpha == 10){
            this._alpha += 1;
                }