MX ActionScript - gotoAndStop within an if statement

Hello everyone!

I have 2 keyframes, both containing buttons and then i load a variable from another document, “messages.txt”. This document only contains one line atm, which is:

messages=1

When messages are more then 0, i want to go to my second keyframe.
This is the code I’m using in keyframe 1:

stop();
loadText = new LoadVars();
loadText.load(“messages.txt”);
loadText.onLoad = function() {
if (messages>0) {
gotoAndStop(2);
}
}

The problem is, it won’t go to keyframe 2, it stops at keyframe 1 even though my var messages is set to 1.

The messages.fla, messages.html/swf and messages.txt are located at http://213.113.144.74/flash/ (One of the above must be put in too, or my webserver will say forbidden.)

Would be very grateful if someone could come up with an answer for this.

Thanks.
/infamous