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