Any way to load in complete html?

Is there any workaround to load in complete html pages with LoadVars ?

I have this client that wants to update some pages (just adding and removing text and pictures), but I would love to do it in action scripting and have him update an external file.

Now I could tell him to remove the tags from <html> to <body> and from </body> to </html>, save it as text file and add a variable (like myText=) at the top of his file, but that wouldn’t make things much easier for him.

He’ll probably start to complain that it would have been easier if I’d made it in html instead of flash :slight_smile:

Does anyone have any other ideas on how to display an html page inside of flash ? (except for opening browser windows and loading the page in that window ofcourse - that isn’t good enough)

Thanks! :slight_smile:

ideea
Let’s say you put a &outsidevar= in the very beggining of your html file, even in front of your <html> tag
Load it with Loadvars object (i don’t know how to work with it :(… but i’ll promise I’ll learn some day :slight_smile: ) then you can put this:

stripedvar = outsidevar.substring(outsidevar.indexOf("<body>"),outsidevar.lastIndexOf("</body>"));

This will you’ll have in your stripedvar variable only the text between the <body> and </body>

Does it help ;)?

I can tell you all about LoadVars, but I never seen that technique you shown before…really cool stuff ! Thanks :slight_smile:

Glad you like it… but i realized it doesn’t work as you wanted… :smiley:
one thing i didn’t noticed first… is that the code above will return a string starting from <body anyproperties> and soo on.
It starts cutting in front of the body.

Solutions.
1- you can add an integger to indexOf("<body");
2- you can put the whole string from <body to the end closing tag of body > including properties or classes.
3- you could add a comment into your html and search for that rather than the <body> tags

Anyway… that “technique” has nothing to do with LoadVars. It’s rather a string technique ;).

Silly me…just replace the ‘but’ with ‘and’ :wink:

Yeah, I could strip it from the index of <body> plus the length of <body> all the way to the index of </body>. (or -1 )

Well, something like that for sure - thanks again! I’ll have a look at it & post my results here :slight_smile: