# How can I load HTML files using actionscript 3.0

**URL:** <https://forum.kirupa.com/t/how-can-i-load-html-files-using-actionscript-3-0/265594>\
**Category:** flash\
**Created:** [July 10, 2008, 3:44pm UTC](https://forum.kirupa.com/t/how-can-i-load-html-files-using-actionscript-3-0/265594 "2008-07-10T15:44:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fs\_tigre](https://avatars.discourse-cdn.com/v4/letter/f/edb3f5/32.png) [@fs\_tigre](https://forum.kirupa.com/u/fs_tigre)\
**Post date:** [July 10, 2008, 3:44pm UTC](https://forum.kirupa.com/t/how-can-i-load-html-files-using-actionscript-3-0/265594/1 "2008-07-10T15:44:19Z")

</div>

[FONT=Calibri][SIZE=3]How can I load html files using actionscript 3.0? [/SIZE][/FONT]

[FONT=Calibri][SIZE=3]Can also this be formatted with CSS?[/SIZE][/FONT]

[FONT=Calibri][SIZE=3]Thanks,[/SIZE][/FONT]  
[FONT=Calibri][SIZE=3]fs\_tigre[/SIZE][/FONT]

---

<div class="post-metadata">

**Author:** ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)\
**Post date:** [July 10, 2008, 4:01pm UTC](https://forum.kirupa.com/t/how-can-i-load-html-files-using-actionscript-3-0/265594/2 "2008-07-10T16:01:07Z")

</div>

It is possible to load an HTML file like this:

```auto
var loader:URLLoader = new URLLoader(new URLRequest('index.html'));
loader.addEventListener(Event.COMPLETE, onComplete);

function onComplete(e:Event):void {
	trace(e.target.data);
}

```

Are you going to be attempting to render HTML inside of Flash inside of a browser? If so, it might be useful to know that Flash can’t render most HTML by itself, it can only handle a few tags… you would have to use AIR or something similar, and I’m pretty sure that those don’t run in the browser as a plugin.

If you just want to display the HTML without rendering it, then you could put the HTML into a TextField and format that text with CSS.

---

<div class="post-metadata">

**Author:** ![fs\_tigre](https://avatars.discourse-cdn.com/v4/letter/f/edb3f5/32.png) [@fs\_tigre](https://forum.kirupa.com/u/fs_tigre)\
**Post date:** [July 11, 2008, 12:31pm UTC](https://forum.kirupa.com/t/how-can-i-load-html-files-using-actionscript-3-0/265594/3 "2008-07-11T12:31:16Z")

</div>

Thank you,

I only need to display the HTML inside flash. For the CSS, do I need to let flash know that the text will be formatted using css or the styles can be part of the HTML file (Internal Style Sheet)?

Thanks,  
fs\_tigre
