Changing Alpha settings via actionscript

Hi, i made text into a movie clip and put in this code to adjust the alpha.

onClipEvent (load){
this._alpha=100;
i=1;
}
onClipEvent (enterFrame) {
if(this._alpha=0 && i==0){
this._alpha+=1;
if(this._alpha>=100){
i=1;
}
}
else{
this._alpha+=1;
if(this._alpha<=0){
i=0;
}
}
}

The alpha is going down… I think, because the text isnt there. What i’m having trouble with is getting it to go back and forth. Increasing and decreasing the alpha when it gets to it’s maximum or minimum. I hope I’m making some sense… Does anyone have any ideas? And no I cannot do this with a simple motion tween because there are things happening in the background.

blah what a waist of time; I just had a few syntax errors :stuck_out_tongue:

i gotta go, check this fla…

for this type of stuff i usually have a three frame movie clip…two layers, one for content and one for code…frame 1 is init, frame 2 is action, frame 3 is loop (back to frame 2)…for me it cleans the logic up a lil and so i can avoid frame events (they scare me)…

if(this._alpha=0 && i==0){
the first part will always result in a true and set your alpha to zero, use…
if(this._alpha==0 && i==0){

however i is one so the else case is performed first setting alpha to 1…therefore this code kinda thrashes between alpha = 0, i = 1 and alpha = 1, i = 1

any help? rob