View Full Version : how to load description text with images?
Fray_quantum
March 19th, 2003, 10:47 AM
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?
kode
March 19th, 2003, 11:36 AM
can you post your code? :)
kode
March 19th, 2003, 11:37 AM
and .. :bad:
welcome to kirupaville Fray_quantum!!! :P ;)
Fray_quantum
March 20th, 2003, 12:46 AM
// 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
kode
March 20th, 2003, 01:06 AM
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 ] no spaces to show your code ;)
Fray_quantum
March 29th, 2003, 10:05 PM
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?
kode
March 29th, 2003, 10:13 PM
yup. try the absolute path =)
eyezberg
March 30th, 2003, 03:22 AM
and make sure it's not a progressive jpg, or it'll never show ;)
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.