# How to load description text with images?

**URL:** <https://forum.kirupa.com/t/how-to-load-description-text-with-images/15931>\
**Category:** Uncategorized\
**Created:** [March 19, 2003, 3:47pm UTC](https://forum.kirupa.com/t/how-to-load-description-text-with-images/15931 "2003-03-19T15:47:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fray\_quantum](https://avatars.discourse-cdn.com/v4/letter/f/c67d28/32.png) [@Fray\_quantum](https://forum.kirupa.com/u/Fray_quantum)\
**Post date:** [March 19, 2003, 3:47pm UTC](https://forum.kirupa.com/t/how-to-load-description-text-with-images/15931/1 "2003-03-19T15:47:30Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 19, 2003, 4:36pm UTC](https://forum.kirupa.com/t/how-to-load-description-text-with-images/15931/2 "2003-03-19T16:36:24Z")

</div>

can you post your code? 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 19, 2003, 4:37pm UTC](https://forum.kirupa.com/t/how-to-load-description-text-with-images/15931/3 "2003-03-19T16:37:17Z")

</div>

and … :bad:

**welcome to kirupaville Fray\_quantum!!! 😛 😉**

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 20, 2003, 5:46am UTC](https://forum.kirupa.com/t/how-to-load-description-text-with-images/15931/4 "2003-03-20T05:46:27Z")

</div>

```auto

// 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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 20, 2003, 6:06am UTC](https://forum.kirupa.com/t/how-to-load-description-text-with-images/15931/5 "2003-03-20T06:06:48Z")

</div>

```auto
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 🙂

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 30, 2003, 3:05am UTC](https://forum.kirupa.com/t/how-to-load-description-text-with-images/15931/6 "2003-03-30T03:05:07Z")

</div>

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](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?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 30, 2003, 3:13am UTC](https://forum.kirupa.com/t/how-to-load-description-text-with-images/15931/7 "2003-03-30T03:13:47Z")

</div>

yup. try the absolute path =)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 30, 2003, 8:22am UTC](https://forum.kirupa.com/t/how-to-load-description-text-with-images/15931/8 "2003-03-30T08:22:28Z")

</div>

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