_root.gotoAndStop(frame);

i store in the database the frame on which a user ended
i retrive it from the database and store it in a variable “frame” when a user clicks “start” button
but when i pass the variable to _root.gotoAndStop(frame);
it doesn’t work root doesn’t go to that frame ?

on (press){

_root.pauseEnterFrame=true;
var post_get_frame:LoadVars = new LoadVars();
var post_id:LoadVars = new LoadVars();
post_id.ID = id;
post_id.sendAndLoad(“http://e-jobs.pl/e-deutsch/getStartFrame.php",post_get_frame,"POST”);
post_get_frame.onLoad = function(success:Boolean) {
if (success) {

    frame = post_get_frame.start_frame;

trace(frame);
}
else {
frame = 2;
}
};
_root.gotoAndStop(frame);
}