How to load description text with images?

i am very new to the flash actionscript stuff, im making somekind of an imageloader flash files, with a next and previous button, and a square to load the *.jpg file, and another square to put a description text. how if i want to give a description text using a *.txt file who has the same name as the image file?

or how to tell flash to display texts inside a textfile in a square?

can you post your code? :slight_smile:

and … :bad:

welcome to kirupaville Fray_quantum!!! :stuck_out_tongue: :wink:


// initialize variables and properties
square._alpha = 0;
_root.descript = x;
whichPic = 1;
// initiate change to new image when buttons are clicked
next.onPress = function() {
	if (whichPic<5 && !fadeIn && !fadeOut) {
		fadeOut = true;
		whichpic++;
		input = whichPic;
		desc = _root.descript;
	}
};
back.onPress = function() {
	if (whichPic>1 && !fadeIn && !fadeOut) {
		fadeOut = true;
		whichpic--;
		input = whichPic;
	}
};
_root.onEnterFrame = function() {
	// when a new Photo is selected, fade out, load new image, and fade in
	if (square._alpha>10 && fadeOut) {
		square._alpha -= 10;
	}
	if (square._alpha<10) {
		loadMovie("../images/image"+whichPic+".jpg", "square");
		loadVariables("../images/image"+whichPic+".txt", "descript");
		fadeOut = false;
		fadeIn = true;
	}
	if (square._alpha<100 && fadeIn && !fadeOut) {
		square._alpha += 10;
	} else {
		fadeIn = false;
	}
	// limit input field
	if (input>5) {
		input = 5;
	}
	// initiate change to new image when Enter key is pressed
	if (Key.isDown(Key.ENTER)) {
		fadeOut = true;
		whichpic = input;
	}
};
// if a number is entered in the input field but Enter is not pressed, change
// back to current Photo number when clicking anywhere else
inputField.onKillFocus = function() {
	desc = desc;
	input = whichPic;
};

=============================================

actually i use the code of the helpfile, and modified it to suit my need, i am really new to this stuff, and i dont know why it doesn,t workout

“square” is the box where the pics gonna display, it worked well

“desc” is the place i wantto put the txt file to display, but it wont come out

loadVariables("../images/image"+whichPic+".txt", "**descript**");

desc” is the place i wantto put the txt file to display, but it wont come out

is it desc or descript?

your text file should be something like:
&description=my description here

and the dynamic text should have description in the var field :slight_smile:

ps. please use code formatting tags [ as ] and [ /as ] [size=1]no spaces[/size] to show your code :wink:

yeah, i,ve made it… but when i upload it to my webserver the *.jpg file wont show out, please check it at http://www14.brinkster.com/perbasi/FLA/cucimata.htm

the text show out but the pic don’t, should i use absolute URL in the pic path?

yup. try the absolute path =)

and make sure it’s not a progressive jpg, or it’ll never show :wink: