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:


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

loadText = new LoadVars();
loadText.onLoad = function() {
if (messages>0) {

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 (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.