Problem with loading external files

I just tried _parent and _root, it doesn’t work :frowning:
Thanks though.

If it still doesn’t work - it might be your dynamic text html activate code.

Try some different stuff like variable. Is contentArea the instance name of the dynamic box or is it the var?

Are you trying to LOAD html INSIDE the box to show people the html or something?

Ah right ok.
contentArea is the name of the box. I just wanted to load some information, not html.

Ok - if contentArea is the instance name, make sure you give it a variable too. Let’s give it the variable myContent.

Then, change your load code to:

loadText = new LoadVars();
loadText.load("HTML.txt");
loadText.onLoad = function() {
	contentArea.text = this.myContent;
};

Thanks for the help Reefster. I tried using the code you posted up, but it didnt seem to work. Now i finally have it working :slight_smile:

The code i used instead: (used one of the tutorials - why didn’t i do this in the first place?? O_o)

loadText = new loadVars();
    loadText.load(".../main.txt");
    loadText.onLoad = function(success) {
        if (success) {
            // trace(success);
            contentArea.html = true;
            contentArea.htmlText = this.text;
        }
    };
	stop();

What?

That’s like the exact code I gave you, all you had to do is add the htmlText part…aw I feel like waste…

oops sorry :frowning: for some reason it didn’t work though. maybe cos you told me to add a variable name to it as well :*(

contentArea.text = this.myContent;

there was this bit also that took the text from the file im assuming, and putting it into the dynamic box. But i tried this and it didn’t work at all for some reason :-/

No problem :)! I’m glad we both know the solution now ;).

:slight_smile:
Ok now that problem has been fixed… another one. Lol.
I want to be able to load different external text files when a user clicks on the buttons, how do i go about that? cos it doesn’t seem to be working :S
Is there a specific way in which i should do this? eg. all different data on the same scene, or in separate scenes?

Depends on where you load them into.

they are all going to be loaded into the same dynamic text box. Sort of like having an iframe i guess, when you click on a link it takes you to some different content

Just add the loading code for each button and assign it to load into the dynamic textbox, this should be simple. It should just automatically change the text once you press the button.

oh right ok. i’ll try that then. I was thinking too much, frame labels etc … lol. I’ll let you know if it works!

Lol Okay get back to me :P.

I have a problem :blush: The linkage buttons are within a movie clip. Must be why im getting error messages maybe?

Bleh. I’m so helpless at this :puzzle:

What do you mean? Why is that a problem and what does that have to do with the loading?

Be specific :P!

I put the loading code for a button, and when i click on the ‘check syntax’ button, it keeps coming up with this error:
Symbol=buttonsXXX, Layer=xxxRollOver, Frame=18: Line 3: Statement must appear within on handler
loadText = new loadVars();

It says it must be on and on handler. If it’s a button you have to add an on (release) { type of thing for any button code ;).

on (release) {
    loadText = new loadVars();
}

oh yeah, never realised. Thanks again Reefster! :smiley: it all works now!

Shoot Self

Common sense man :P!