I have a pure as3 project I would like to use this in, but I'm not quite sure if it's posssible.
I've tried a basic test:
----
var htmlString:String = "<html><head><title>Hello HTML</title></head><body><p>Hello World!</p></body></html>";
var html:Element = HtmlParser.parse(htmlString);
var o:UIComponent = FlashHtmlRenderer.render(html);
if (o == null)
{
trace("Unable to render html");
return;
}
addChild(o);
----
But I get:
[Fault] exception, information=Error: No class registered for interface 'mx.styles::IStyleManager2'.
Fault, Singleton.as:111
I'm guessing it's the flex components that fail.
Any idea before I spend more time on it?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is the only html parser (for flash) i found on the web in 2 days…
So i gues i'll try to make it a pure as3 project - i like Flex as much as i like the Flash IDE.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In FleshHTMLRendered.as, method renderHelper, where you check the elementType, there is no case for Constant.elementTypeHTML. You create the base element for this object but the "default" in the switch changes it to null. So, any html code that has a html tag won't render (will throw an exception trying to add a child null to the container).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a pure as3 project I would like to use this in, but I'm not quite sure if it's posssible.
I've tried a basic test:
----
var htmlString:String = "<html><head><title>Hello HTML</title></head><body><p>Hello World!</p></body></html>";
var html:Element = HtmlParser.parse(htmlString);
var o:UIComponent = FlashHtmlRenderer.render(html);
if (o == null)
{
trace("Unable to render html");
return;
}
addChild(o);
----
But I get:
[Fault] exception, information=Error: No class registered for interface 'mx.styles::IStyleManager2'.
Fault, Singleton.as:111
I'm guessing it's the flex components that fail.
Any idea before I spend more time on it?
It looks like this code is dependent on flex. Any plans or thoughts about how to remove flex dependencies from this project?
This is the only html parser (for flash) i found on the web in 2 days…
So i gues i'll try to make it a pure as3 project - i like Flex as much as i like the Flash IDE.
In FleshHTMLRendered.as, method renderHelper, where you check the elementType, there is no case for Constant.elementTypeHTML. You create the base element for this object but the "default" in the switch changes it to null. So, any html code that has a html tag won't render (will throw an exception trying to add a child null to the container).
I also had this, but changed the swc link type to external. But then it comes up with another error I have just posted in the help forum.