Hi! First of all, thanks for creating and maintaining this project.
If I've understood what it does, this is what has been missing in
Flash for a long time :-)
Anyway, I'm having trouble implementing it in Flash environment (not
Flex).
The logic I've tried is this:
* create Sprite container for the html
* add htmlwrapper to the container
* display html in the htmlwrapper
A short pseudo code:
public class TestPage extends MovieClip
{
public function TestPage()
{
var container:Sprite = new Sprite();
... place the container on stage. set x, y, width, height
var html:Html = new Html(container, "html location, e.g.
http://localhost/test.html");
}
}
I've had two issues with this approach:
1) loadStyles function in
com.base.parse.Html.as
* this code I do not understand:
links = html.head.link.length() - 1;
if( links == 0 ){ throw ...;
* if I have 1 css link line in html, then this will always throw
error?
* I've bypassed it by creating two css lines in html but maybe I am
misinterpreting something?
2) render function in
com.base.parse.Html.as
* it throws an error on this line:
var root:Element = new Element( ev.target, style, target );
* the error message is ReferenceError: Error #1069 Property STYLE not
found on Flash.display.Sprite and there is no default value.
* also in trace i get "You have loaded no fonts, this means you can
write no text."
I am half guessing that I'm missing something, especially with loading
fonts but I just can't find a solution.
I'm including my html and css files (both are accesible through web
browser when I start localhost):
/******************************
test.html
******************************/
<html xmlns="
http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link rel="stylesheet" href="
http://localhost/test.css" type="text/
css" />
<link rel="stylesheet" href="
http://localhost/test.css" type="text/
css" />
</head>
<body>
Hello...
</body>
</html>
/******************************
test.css
******************************/
/* hide from ie on mac \*/
html {
height: 100%;
overflow: auto;
}
/* end hide */
body {
height: 100%;
margin: 0; padding: 0;
}