[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]
It is possible to load an HTML file like this:
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.
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