# Dynamicacly loading HTML

**URL:** <https://forum.kirupa.com/t/dynamicacly-loading-html/26201>\
**Category:** flash\
**Created:** [July 20, 2003, 9:25pm UTC](https://forum.kirupa.com/t/dynamicacly-loading-html/26201 "2003-07-20T21:25:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![RussianBeer](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/russianbeer/32/152_2.png) [@RussianBeer](https://forum.kirupa.com/u/RussianBeer)\
**Post date:** [July 20, 2003, 9:25pm UTC](https://forum.kirupa.com/t/dynamicacly-loading-html/26201/1 "2003-07-20T21:25:46Z")

</div>

Hey, I’ve got the hang of dynamicaly loading text, but I need to load HTML with some images, searching the forums I came upon some bits of pieces of answers, but nothing concrete.

So far I came up with this, but it dosent work.

> main.html=true;

loadText = new loadVars();  
loadText.load(“main.txt”);  
loadText.onLoad = function() {  
scroller.html=true;  
scroller.html = this.maintext;  
scroller.htmlText = this.maintext;

};

Well…  
Thanks ahead of time!`

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 20, 2003, 9:35pm UTC](https://forum.kirupa.com/t/dynamicacly-loading-html/26201/2 "2003-07-20T21:35:37Z")

</div>

You cant load in HTML pages into flash. Sorry.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 20, 2003, 9:56pm UTC](https://forum.kirupa.com/t/dynamicacly-loading-html/26201/3 "2003-07-20T21:56:50Z")

</div>

But can you load HTML files (images and sort of) dynamicaly, or something…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 20, 2003, 11:47pm UTC](https://forum.kirupa.com/t/dynamicacly-loading-html/26201/4 "2003-07-20T23:47:44Z")

</div>

you can use load image but it will only load images which will be stored on a website you jsut got to tell flash where its located so it can load it sort of like when you link images in DW you have to specify the path where its stored 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 20, 2003, 11:50pm UTC](https://forum.kirupa.com/t/dynamicacly-loading-html/26201/5 "2003-07-20T23:50:55Z")

</div>

try this:

```auto
loadText = new loadVars(); 
loadText.onLoad = function(success) {
if(success) {
scroller.html=true;
scroller.htmlText = this.maintext;
} else {
trace("failed to load file");
}
}
loadText.load("main.txt");

```

it should work 😉

[edit]

only these html tags can be used though

[http://www.macromedia.com/support/flash/ts/documents/htmltext.htm](http://www.macromedia.com/support/flash/ts/documents/htmltext.htm)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 21, 2003, 6:03am UTC](https://forum.kirupa.com/t/dynamicacly-loading-html/26201/6 "2003-07-21T06:03:24Z")

</div>

> but I need to load HTML with some images,  
> Right, but you can’t load in images into a dynamic text box. You’ll have to load in the pictures seperately from the text. Right?
