With the help of Kode, I have figured out how to randomly load and fade in poems from text files. Only, after trying to add additional functionality, namely, an index from which visitors may choose a poem to load, I have run into problems. To put it simply, I can’t figure out how to modify the code he provided to load text onto level0 from an SWF loaded on a level above that. Here’s some sample code I placed on a button, and is intended to load a text file into “poembox” on the stage of level 0:
on (release){
var poem = new LoadVars();
poem.onLoad = function(ok) {
if (ok != false) {
this.onData = function(src) {
if (src != undefined) {
_level0.poembox._alpha = 0;
_level0.poembox.text = src;
fadeIn(5);
} else {
_level0.poembox.text = "Error.";
}
};
this.load("poem01.txt");
} else {
_level0.poembox.text = "Error loading file.";
}
};
}
Here’s the url for the files required: http://home.comcast.net/~peachsnowfalling/poemindex.rar… Main.swf is the main site, which provides a button labeled “INDEX”. PoemIndex.fla is the source for the swf loaded when the user clicks the INDEX button. “mcButtons” holds all the buttons for each individual poem (wish I didn’t have to hard code all of it), and I’ve also provided “poem1.txt”, for testing purposes. If someone can pleasehelp me with this I’d be eternally grateful! I’ve tried contacting Kode a number of times as he’s the one who helped me originally, with no luck. Too bad I don’t have his e-mail
Cheers,
The Red Fall