# Class property definitions error

**URL:** <https://forum.kirupa.com/t/class-property-definitions-error/330541>\
**Category:** Uncategorized\
**Created:** [February 6, 2013, 10:05am UTC](https://forum.kirupa.com/t/class-property-definitions-error/330541 "2013-02-06T10:05:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![catcat31](https://avatars.discourse-cdn.com/v4/letter/c/ea5d25/32.png) [@catcat31](https://forum.kirupa.com/u/catcat31)\
**Post date:** [February 6, 2013, 10:05am UTC](https://forum.kirupa.com/t/class-property-definitions-error/330541/1 "2013-02-06T10:05:06Z")

</div>

Hi,  
I’m getting the following message on my code. Please can someone show me how to amend it please?  
_private class may only be used on class property definitions error._ (line 88, 92).  
package {  
import flash.display._;  
import flash.events._;

public class MatchingGame5 extends MovieClip {  
// game constants  
private static const boardWidth:uint = 6;  
private static const boardHeight:uint = 6;  
private static const cardHorizontalSpacing:Number = 52;  
private static const cardVerticalSpacing:Number = 52;  
private static const boardOffsetX:Number = 120;  
private static const boardOffsetY:Number = 45;  
private var firstCard:Card;  
private var secondCard:Card;

public function MatchingGame5():void {  
// make a list of card numbers  
var cardlist:Array = new Array();  
for(var i:uint=0;i\<boardWidth\*boardHeight/2;i++) {  
cardlist.push(i);  
cardlist.push(i);  
}

// create all the cards, position them, and assign a randomcard face to each  
for(var x:uint=0;x\<boardWidth;x++) { // horizontal  
for(var y:uint=0;y\<boardHeight;y++) { // vertical  
var c:Card = new Card(); // copy the movie clip  
c.stop(); // stop on first frame  
c.x = x_cardHorizontalSpacing+boardOffsetX; // set position  
c.y = y_cardVerticalSpacing+boardOffsetY;  
var r:uint = Math.floor(Math.random()\*cardlist.length); // get a random face  
c.cardface = cardlist[r]; // assign face to card  
cardlist.splice(r,1); // remove face from list  
c.addEventListener(MouseEvent.CLICK,clickCard); // have it listen for clicks  
addChild©; // show the card  
}  
}

close\_btn.addEventListener(MouseEvent.CLICK, closeMe);  
minimise\_btn.addEventListener(MouseEvent.CLICK, minimiseMe);  
}

// player clicked on a card  
public function clickCard(event:MouseEvent) {  
var thisCard:Card = (event.target as Card); // what card?

if (firstCard == null) { // first card in a pair  
firstCard = thisCard; // note it  
firstCard.gotoAndStop(thisCard.cardface+2); // turn it over

} else if (firstCard == thisCard) { // clicked first card again  
firstCard.gotoAndStop(1); // turn back over  
firstCard = null;

} else if (secondCard == null) { // second card in a pair  
secondCard = thisCard; // note it  
secondCard.gotoAndStop(thisCard.cardface+2); // turn it over

```
// compare two cards
if (firstCard.cardface == secondCard.cardface) {
 // remove a match
 removeChild(firstCard);
 removeChild(secondCard);
 // reset selection
 firstCard = null;
 secondCard = null;
}

```

} else { // starting to pick another pair  
// reset previous pair  
firstCard.gotoAndStop(1);  
secondCard.gotoAndStop(1);  
secondCard = null;  
// select first card in next pair  
firstCard = thisCard;  
firstCard.gotoAndStop(thisCard.cardface+2);  
}  
}

private function closeMe(e:MouseEvent):void{  
stage.nativeWindow.close();  
}

private function minimiseMe(e:MouseEvent):void{  
stage.nativeWindow.minimize();  
}

}  
}
