A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: variable checking <=(

  1. #1
    Member
    Join Date
    Jun 2002
    Posts
    38
    i have a problem wid checking a variable inside a text files.

    Code:
    on (release) {
    	myVars = new LoadVars();
    	myVars.load("nb_chk.txt");
    	myVar.onLoad = function(success) {
    		if (success) {
    			if (nb_checker == "1") {
    				gotoAndStop("notice board");
    			}
    		}
    	};
    }
    basically wha i want it to do is load a text files ( nb_chk.txt ) and inside the text file it has a variable called ( nb_checker ) inside the text file it has ( nb_checker=1 ) and what i want my script above to do is check to see ( nb_checker=1 ( this is inside ma text file ) ) equals to whats i got (nb_checker == "1" ( this is inside my swf file ) ) . I have also made sure that alll the variables and the text file r correct and i also made sure the file is in the right location... nothing is happening . anyone know why it's not performing this???

  2. #2
    aCtioNScRipTer
    Join Date
    Feb 2001
    Posts
    274
    have u checked the debugger and see if nb_checker = "1"?
    If it is confirmed = 1 then add _root. to your gotoAndStop("notice board") which is _root.gotoAndStop("notice board").

  3. #3
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Could be a typo here, but make sure your third line is myVars... And add the bold line!

    myVars = new LoadVars();
    myVars.load("checker.txt");
    myVars.onLoad = function(success) {
    if (success) {
    nb_checker = this.nb_checker;
    if (nb_checker == 1) {
    //trace (nb_checker);
    _root.gotoAndStop("notice board");
    }
    }
    };

  4. #4
    Member
    Join Date
    Jun 2002
    Posts
    38
    Originally posted by oldnewbie
    Could be a typo here, but make sure your third line is myVars... And add the bold line!

    myVars = new LoadVars();
    myVars.load("checker.txt");
    myVars.onLoad = function(success) {
    if (success) {
    nb_checker = this.nb_checker;
    if (nb_checker == 1) {
    //trace (nb_checker);
    _root.gotoAndStop("notice board");
    }
    }
    };
    thx's man!!! it works wonder!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center