Pretty simple, actually. Each achievement has its own test function, AchTest_<achievement type>.
But what is used to check if you completed one of them is the TestAll function. Like this:
public function TestAll()
{
var _loc_1:Achievement = null;
var _loc_2:Boolean = false;
var _loc_3:Boolean = false;
this.unlockedList = new Array();
for each (_loc_1 in this.list)
{
_loc_1.justCompleted = false;
_loc_1.justFailed = false;
_loc_1.failString = "";
if (_loc_1.complete == false)
{
_loc_2 = true;
if (_loc_1.specificLevel != -1)
{
if (_loc_1.specificLevel != Game.currentLevel)
{
_loc_2 = false;
}
}
else
{
_loc_2 = true;
}
if (_loc_2)
{
this.failString = "undefined";
Utils.GetParams(_loc_1.testFunctionParams);
var _loc_6:String = this;
_loc_3 = _loc_6.this[_loc_1.testFunction]();
if (_loc_3)
{
this.failString = "";
_loc_1.justCompleted = true;
Utils.GetParams(_loc_1.completeFunctionParams);
var _loc_6:String = this;
_loc_6.this[_loc_1.completeFunction]();
_loc_1.complete = true;
this.unlockedList.push(_loc_1);
continue;
}
_loc_1.failString = this.failString;
_loc_1.justFailed = true;
}
}
}
if (Lic.GetLicensor() == Lic.LICENSOR_KONGREGATE_ONSITE)
{
Lic.Kong_SubmitStat(this.CountAchievementsComplete(), "achievements_complete");
}
return;
}// end function
If you take a look at the function above, you'll notice we need _loc_2, whatever that is, to be true. So the first array does that, setting _loc_2 as true.
Then it gets the parameters needed for the achievements' test function and puts the value returned by it in _loc_3. After that, it checks if _loc_3 is true or false to give you or not the achievement. So I changed _loc_3 to _loc_2, as it is always true(we already did that with the first array). That's what the second one does. o/
If that wasn't clear enough, I can explain again