Conditional loops not working in an as3 game

Hi,

i madly trying to finish a final project for a class i’m taking, and i got hung up on the ‘matching’ part of my matching game.

code for card.as looks like this:

public function flip(evt:MouseEvent = null):void {
    
    var thisCard = evt.target;
    
    TweenMax.to(this, 1, {scaleX:0, ease:Quad.easeInOut});
    TweenFilterLite.to(this, 1, {blurFilter:{blurX:5}}); 
    TweenFilterLite.from(this, 1, {blurFilter:{blurX:0}});     
    TweenMax.to(this, 1, {scaleX:1, ease:Quad.easeInOut, delay:1});
    
    if (firstCard == null) {
        
        firstCard = thisCard;
        TweenMax.to(image, 0.5, {alpha:1, ease:Quad.easeInOut, delay:1});
        trace(this.cardFace);
        flipped = true;
        }    
        
    else if (firstCard == thisCard) {

        TweenMax.to(image, 0.5, {alpha:0, ease:Quad.easeInOut, delay:1});
        flipped = false;
        firstCard = null;
        
    }
    
    else if (secondCard == null) {
        
        secondCard = thisCard;
        TweenMax.to(image, 0.5, {alpha:1, ease:Quad.easeInOut, delay:1});
        flipped = true;
    
        if (firstCard == secondCard) {
        
            removeChild(firstCard);
            removeChild(secondCard);
            trace(firstCard);
            trace(secondCard);                
            firstCard = null;
            secondCard = null;
        
        }
        
    }

i can trace cardFace so that the trace returns the letter i need to match, but i’m having trouble getting it to do what i want.

any ideas?

i have other stuff going on in my document class…i can zip both files up to show what i’m doing.