# Help with dynamic text and slide show

**URL:** https://forum.kirupa.com/t/help-with-dynamic-text-and-slide-show/31949
**Category:** flash
**Created:** [September 29, 2003, 5:15pm UTC](https://forum.kirupa.com/t/help-with-dynamic-text-and-slide-show/31949 "2003-09-29T17:15:09Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![rogerio26](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@rogerio26](https://forum.kirupa.com/u/rogerio26)
#### Post date: [September 29, 2003, 5:15pm UTC](https://forum.kirupa.com/t/help-with-dynamic-text-and-slide-show/31949/1 "2003-09-29T17:15:09Z")

</div>

I got from DEVNET a slide show code and a load variable text code.  
I’m trying to add feature in the codes that when the next button or the back button  
on the slide show is pressed will appears a text on the dynamic text box that I put in the botton of the slide show, releated wich the picture is showing on the slide show.  
// image1.jpg will have the scroller.text = var1  
// image2.jpg will have the scroller.text = var2  
// image3.jpg will have the scroller.text = var3

I try to included the following code and with out any surprise it didn’t work:

if (input = 1) {  
scroller.text = this.var1;  
} else {  
if (input = 2) {  
scroller.text = this.var2;  
} else {  
if (input = 3) {  
scroller.text = this.var3;

Thanks in advance for any help.  
Rogerio

Here are the two original codes from DEVNET:

loadVarsText = new loadVars();  
loadVarsText.load(“test.txt”);  
loadVarsText.load(“test2.txt”);  
loadVarsText.load(“test3.txt”);  
loadVarsText.onLoad = function(success) {  
if (success) {  
trace(“done loading”);  
scroller.text=this.var1;  
} else {  
trace(“not loaded”);  
}  
};

//initialize variables and properties  
square.\_alpha = 0;  
whichPic = 1;  
//initiate change to new image when buttons are clicked  
next.onPress = function() {  
if (whichPic\<3 && !fadeIn && !fadeOut) {  
fadeOut = true;  
whichpic++;  
input = whichPic;  
}  
};  
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”);  
fadeOut = false;  
fadeIn = true;  
}  
if (square.\_alpha\<100 && fadeIn && !fadeOut) {  
square.\_alpha += 10;  
} else {  
fadeIn = false;  
}  
// limit input field  
if (input\>3) {  
input = 3;  
}  
// 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() {  
input = whichPic;  
};

* * *
