Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loading text from outside file

Status
Not open for further replies.

janna30

MIS
Dec 13, 2003
3
US
Hi! I am trying to load text into a Flash presentation from an external text file. The external photos are loading without a problem. When I push a button, I want the text to load. But I am having trouble with the action script (I am new to this). I am not receiving any error message in Flash.

I have the following on my actions frame in main movie:

total_photos = 7;
myCaptions = new LoadVars();
myCaptions.load("maptext.txt");
info_txt.text = eval("myCaptions.info" + newnumber);
title_txt.text = eval("myCaptions.title" + newnumber);

On the buttons inside the movie clip I have (number of photo varies):

on (release) {
current_photo = "photo2.jpg";
newCaption = myCaptions.title2;
newCaption = myCaptions.info2;
};

Thanks for any suggestions you can make!

Janna



 
Try this:

on(release){
current_photo = "photo2.jpg";
newCaption = _root.myCaptions.title2;
newInfo = _root.myCaptions.info2;
}

If I understand your problem correctly that should do it. Notice I changed the second variable name. The way you had that written "info2" would have overwritten "title2".

Wow JT that almost looked like you knew what you were doing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top