Rendering problem + tables

17 views
Skip to first unread message

Vax

unread,
Sep 13, 2008, 8:22:08 AM9/13/08
to htmlwrapper
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;
}
Message has been deleted

ZBoris

unread,
Oct 15, 2008, 2:10:29 AM10/15/08
to htmlwrapper
Hey,

Im struggling with similar problem too:
1. CSS
either link 2 css files in your html or remove that -1 from
" links = html.head.link.length() - 1; " code
2. Property style not found
I found no way of puttin it in some child container but the root one
only.
in other words your code for Html constructor should have "this",
rather than "container"
var html:Html = new Html(this, "html location, e.g. http://localhost/test.html");

3. Fonts
make sure you define at least one font in your CSS, eg:
p {
font-file: url("assets/fonts/Verdana.swf");
font-family: "Verdana";
color: #AAAAAA;
font-size: 11;
padding-top:30px;
}

May be I am wrong somewhere, thats why id rather wait for s asecond
opinion

Cheers,
BZ

On Sep 13, 11:22 pm, Vax <elVa...@gmail.com> wrote:
> 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");
Reply all
Reply to author
Forward
0 new messages