A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Problem with variable from an instance txt field

  1. #1
    Member
    Join Date
    May 2003
    Location
    @ work
    Posts
    45

    Problem with variable from an instance txt field

    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!

  2. #2
    Have you tried tracing aantal2 or the text file variable? It's possible that the text file has an extra space or newline that's making it be read as a string. That's the only thing that comes to my mind right now.

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