Using: if TextboxA > TextboxB make image visable
The idea below is that if the score of Player 1 is higher than Player 2, then it is meant to show the winner image (unless the value is the same). I should note that the image is made invisible by another function already. It will work sometimes but not others. Can someone please help?
Thanks!
//Variable
var nAddPP1:Number=0;
var nAddPP2:Number=0;
//Functions
function fWinner(evt:MouseEvent):void{
nAddPP1= Number(TXT_Output1.text);
nAddPP2= Number(TXT_Output2.text);
if (nAddPP2 >= nAddPP1){
mcWinner2.visible = true;}
if (nAddPP1 >= nAddPP2){
mcWinner1.visible = true;}
if (nAddPP1 == nAddPP2){
mcDraw.visible = true;}
}
bBTN_Click.addEventListener(MouseEvent.CLICK, fWinner);