View Full Version : Is there a command to load an html page directly into a text field?
Andy.burnett
04-02-2002, 04:56 PM
I have more or less got the hang of parsing and loading XML, but what I want to do now is simply load a url into a text field. I know that Flash only supports a very limited range of html tags, but my html is very simple. Loadvariables appears to only load encoded strings, is there another command that accepts a url as an argument and loads that page?
jimburton
04-04-2002, 12:02 PM
You can't have a "source" in that way for dynamic text fields - put the html into a variable and use loadVariable to get it:
//contents of a text file html.txt
&myHTML="<b><a href='link.html'>this is some html</a></b>"&dataloaded=true&
then in you fla:
loadVariables("html.txt");
you then have the variable myHTML available and it will show up in dynamic text fields with the variable set to its name. Remember to select the html and multiline options.
any good?
Andy.burnett
04-04-2002, 12:16 PM
Presumably this means that if I was trying to load the contents of a page into a variable, I need to wrap the page in the &name= bits in order that the loadvariables will work?
jimburton
04-04-2002, 12:41 PM
that's right, and you could feasibly load many html strings by going &name1=code...&name2=code...& etc
I usually stick a variable called something like dataLoaded on the end so that you can check whether it's all loaded properly by going
if(dataLoaded) {
etc etc
}
Andy.burnett
04-04-2002, 12:57 PM
I will definitely use that :)
TVM
AB
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.