I’m trying to gain the ability to change a BOOL variable from false to true within a function of another file. The variable in this case is named “messFin”. I can’t get it to register as true in the main file.
Here’s the call to the function in the main file (main.hx):
south = 10;
east = 5;
c = 0;
messFin = false;
Messages.ShowMess(south, east, mess, messFormat, messPage, messFin, c);
trace(messFin);
Here’s the code for the 2nd file (messages.hx):
package;
import openfl.text.TextField;
import openfl.text.TextFormat;
class Messages
{
public static function ShowMess(south:Int, east:Int, mess:TextField, messFormat:TextFormat,
messPage:Int, messFin:Bool, c:Int):Void { //c is which colPerson hit
if (south == 10 && east == 5 && c == 0) {
mess.text = "What are you doing this far west of xxx?";
messFin = true;
}
}
}