Complete Newbie here come to blow your mind

Hey all.

I am trying to use if and else statements and failing. I am either completely missing their purpose, or just not writing the correct code. Scenario: I have designed a gallery that consists of animation in movie clips that are placed on the time line. With the *if/else *statements I need Flash to know what movie clip the user is on, so that the users next action loads the correct movie clip.

If someone is willing to take a look over the code I have written it would be highly appreciated. Again I am sorry if this question and scenario comes across as dum, this is all very new and confusing to me.

_global.imageNumber=0;

massButt.onRelease=function(){

if (_global.imageNumber=1){
    imageHolder.gotoAndStop(imageNumber); 
    
} else if (_global.imageNumber) {        
    imageHolder.gotoAndStop(); 

}

_global.imageNumber=1;
trace(imageNumber);

}

gearsButt.onRelease=function(){

if (_global.imageNumber=2){
    imageHolder.gotoAndStop(imageNumber); 
    
} else if (_global.imageNumber) {        
    imageHolder.gotoAndStop();

}

_global.imageNumber=2;
trace(imageNumber);

}

tombButt.onRelease=function(){

if (_global.imageNumber=3){
    imageHolder.gotoAndStop(imageNumber); 
    
} else if (_global.imageNumber) {        
    imageHolder.gotoAndStop();

}

_global.imageNumber=3;
trace(imageNumber);

}