Hé guys, if got a throbbin headache from this problem for over a week now. Maybe somebody can cure me.

I'm building a very small CMS system, but got some problems with a variable. Flash reads a txt file with a number that specivies the number of images to display in the swf). Flash reads it and drops it in a txtfield with the instance name "aantal", the same txtfield has also the variable name "aantal2". The code (shown in Bold) doesn't work, but when I just type (so flash doesn't read it from the txt file) the variable in flash, it works! What am I doing wrong? I've tried to send the Number from the instance txt field to an empty txt field with the variable name "aantal2" but no cure! It just doesn't read the variable, becouse '_root.buttnext' goes invisible when i press the button.

Code:
on (release) {
	foto = Number(foto)+1;
	next = "image"+(Number(foto))+".jpg";
	loadMovie("images/"+(_root.next), "_root.container");

	if (Number(foto)>=Number(aantal2)-1) {
		setProperty("_root.buttnext", _visible, "0");
	} else {
		setProperty("_root.buttnext", _visible, "1");
		}

	if (Number(foto)>1) {
		setProperty("buttprev", _visible, "1");
	} else {
		setProperty("buttprev", _visible, "0");
		}
}
I am a designer working on a MAC with Flash 8 Pro. Please help, my medications are getting low!