Help with my poetry website (LoadVars)

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 :frowning:

Cheers,

The Red Fall

groan I’m never going to get help, am I? Kode… Where art thou, Kode?

=\

Um, is anyone alive? What happened here? It seemed it would be an easy problem to solve for most Flash users… Anyone here? I just hate that I can’t update my site and add an index because of this AS problem. Grr, my incompetence!

hah red fall, I think some of us are listening to you. Your code seems unfamiliar to me. I’ve loaded text files from external sources before but your coding is either wrong or its another way of coding i havent seen before.

this.load(“poem01.txt”); – I just wanted to point out that usually I put this.load(“mytextfile.txt”) as what my variable loads. If you have AIM I can help you out much quicker, my AIM sn: cpfatguy4u

Thanks, bobdoe. Yeah, for some reason Kirupaforum has misinterpreted my quotes as “"”, so maybe that’s confusing all of you. But really, I’d just download the rar and check out the real code. Maybe I’ll try to edit the original post and find another tag to format it. The code was given to me by a guy named Kode, and I assure you it works fine when loading txt files randomly, I just can’t get it to load specified text files from a loaded movie on top of the base level 0. I’ll contact you on AIM if I get a chance. Thanks.