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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load HTML 2

Status
Not open for further replies.

alokwww

Technical User
Dec 25, 2002
86
Hi, I'm trying to follow the tutorial at but am having some troubles.

All I'm trying to do is load an html file named test.html into a dynamic text box with an instance name of scroller.

I'm sure this is much simpler than I'm making it, but I'm totally lost... do I use loadVarsText or loadVariables? I tried loadVariables but it said I needed to define 2 or 3 spaces (I had it like loadVariables(test.html);).

It seems like even when I follow the tutorial instructions exactly, I end up with an empty text box.

Could someone with a minute or two please let me know what code I should use with an html file named test.html and a textbox named scroller?

Thanks
-Alok

I promise I'll give you a star [thumbsup]!
 
Loading content into text boxes is best done from a plain text (.txt) file not an HTML file - Flash can only read certain HTML formatting tags. If you're trying to load in a normally fomatted HTML file into Flash that's whay nothing's appearing: things like <HEAD> tags etc aren't recognised.

You can use <FONT> tags and the like in your text file to format the text you want to display.

Also remember that you have to have the text as a variable:

myText=blahblah

...then set the MX textfield's htmlText property to be equal to that variable or, again, nothing will appear.

myTextBox.htmlText=myText;

In MX loadVars() is definitely the way to go.
 
vars.txt:

var1=blablabla&var2=yadieyadie<b>bold</>

----- flashMX

mydata = new loadvars();
mydata.Load(&quot;vars.txt&quot;);
mydata.onload = function() {
gotoAndPlay(2);
};
stop();


then your variables can be called like this:

_root.mydata.var1
// this is &quot;blablabla&quot;
_root.mydata.var2
// this is &quot;yadieyadie<b>bold</>&quot;


good luck

I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
Thanks for your responses! Everything worked great. I have one mroe question. Can I use loadmovie to load an html file into a movie clip using something like:

loadMovie(&quot;one.html&quot;, &quot;onemc&quot;);

Thanks guys!
-Alok
 
i dont think that will work,

you can load swf's, gifs, pngs, and jpgs but i dont think you can load html's

if you want an entire html in your flash y not use a framesetting. with a flash menu left and the right frame being either HTML or flash?

that way the html can become a part of your site without having to import it.

I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
Okay, thats good to know. Thanks again!
 
glad to help :)

I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top