Text from .txt not loading into nested clip

my .txt file is not loading into my nested movie clip for some reason. I think I have directed it correctly (a section of the code is below which I think is the problematic part)

onClipEvent (load){
_parent.contents.vitaHolder.loadVariables(“http://www.tonyoursler.com/tonyourslerv2/vita/solo.txt”);
_parent.contents.vitaHolder.loadText.onLoad = function() {
_parent.contents.vitaHolder.daTextBox.html = true
_parent.contents.vitaHolder.daTextBox.htmlText = this.daTextBox;
}

I have always had problems with loading outside text into nested mcs. Hoping to understand once and for all!!!

mista

I have seen people put an HTML page up on the web and then try to load it into a flash .swf just by putting an http: call into the loadVariablesNum();

I have, sort of like a <frameset /> in HTML coding.

Doesn’t seem to work out for them all that much…

May’be it’s because they do not set up the text file holding their HTML properly, or may’be the HTML is too complex, or even they try to do what some do with framesets and try to “trap” someone else’s HTML page or a section of their previous HTML site as they move to a flash option with their upgraded site.

I am not saying you can’t do it this way. I just know that success seems better when the .txt file is in the same directory as the .swf and relatively called in to play.

–vagabond007

Have you tried tracing the path inside the onLoad handler to see if it’s correct ?

thanks for all the information guys, I am just trying to digest it all…

vagabond007, I am not sure if I am understanding correctly what you’ve written but I am not trying to load an html document into my .swf, just a regular .txt file.

here is the .fla, maybe that will help…thanks again

any ideas???

I had the same problem. It doesn’t matter if its html or txt. If you place it in a different folder etc you will need to give the full url.

SO firstly upload the .txt file onto your web server. Copy the EXACT url eg. http://www.somewhere.com/text.txt and place it into your code.

norie was right. THE problem is most likely just your url. REMEMBER it must be exactly the right url. You can check the url on your web server admin. If you don’t have one just try out different urls eg.
http://www.somewhere.com
http://somewhere.com

sometimes even the www. is no needed. YOU ALWAYS need the http://

IT is also case Sensitive

ok, im not quite sure what’s wrong with your fla… too much code and it doesn’t stop. at any rate:

#1 Use an INSTANCE name NOT a VAR name! So, delete the var name from you text box, and change the instance name to “daTextBox” or whatever it was.

#2 instead of using the code you have to load the text use the code i mentioned earlier:

	loadText = new LoadVars();
	loadText.load("solo.txt");
	loadText.onLoad = function() {
		daTextBox.html = true;
		daTextBox.htmlText = this.daTextBox;
	};

#3 You MUST format your text file according to the HTML query standard:

myFirstVar=this is what the first var Equals&mySecondVar=tis is what my second var equals

so in your case:

daTextBox=this is what my var equals

Although you shouldn’t name your textbox and textbox var the same thing. So you might want to think about changing one of those.

#3 Your text file can only include VALID characters and remember everytime you insert an “&” sign that is gonna be the definition of a variable untile it sees an equal ( = ) sign.

#4 Reference your paths relatively using dots and slashes!

:stuck_out_tongue:
aaron

I cehck your files and its not pretty. I suggest you use the kirupa tutorial. Its more simple and it works. REMEBER about the addressing.

http://www.kirupa.com/developer/mx/dynamic_scroller.htm

well there you go norie replyed while i was typing my response. i use that code too and it works great!

oops use this instead, it’ll help you narrow your problem down:


loadText = new LoadVars();
loadText.load("solo.txt");
loadText.onLoad = function(success) {
	if (success) {
		daTextBox.html = true;
		daTextBox.htmlText = this.daTextBox;
		trace(this.daTextBox);
	} else {
		trace("error homie :-( ");
	}
};

hey norie and dreamer. Thanks for all of your help. Dreamer, the url is correct, I usually make a mistake typing the url but i checked this one bout 20 times.

Norie, thanks for the code man. I’m trying it but I’m confused bout #3. I deleted the variable name for my text box and made my Instance name daTextBox but I’m not sure what you mean by this

daTextBox=this is what my var equals

I assume this is the first line for my .txt file. But what does “this is what my var equals” mean. Is that just the text that wants to be loaded?

I also deleted all of my text to see if the it was loading (I realised just after I read your post about the &'s in the text) but still no luck. Hope you can clarify, thanks so much for sticking with this

Best
mista

also I am getting an error message of “undefined” when I publish to .swf. What does that mean?