delfick / flex-htmlfilter

Automatically exported from code.google.com/p/flex-htmlfilter
0 stars 0 forks source link

htmlText appears empty #4

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I cannot seem to use htmlText within my application.

I have taken the following steps:

1. Built and tested the sample index.mxml. Works fine.

2. Created a flex library project in FlexBuilder (on Ubuntu) called
htmlFilter and added the source from the "as" directory created while
building htmlFilter. From what I can see, this contains the generated
ActionScript created after the preprocessor did its work. I am not very
familiar with the preprocessor, but the library project builds fine.

3. Made my project dependent on the library project and created a simple
version of index.mxml app within my project that just displays the htmlText
with some html in it. This works fine. So the building of the library and
exporting of components seem to be fine.

My simple test mxml app:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application
 xmlns:mx="http://www.adobe.com/2006/mxml"
 xmlns:html="com.htmlFilter.*"
 width="100%" height="100%"
 backgroundColor="#ffffff"
 >
 <mx:Script>
  <![CDATA[
   import com.htmlFilter.htmlFilter;
   import flash.events.*;

   private var theHtmlFilter:htmlFilter = new htmlFilter();      
   private var theText:String = theHtmlFilter.filterContent("<p>nothing
important</p><ol><li>item</li><li>item</li><li>item</li></ol>");

  ]]>
</mx:Script>

    <html:htmlText text="{theText}" id="theTextArea"
    width="100%" height="100%" cssFile="css/html.css"
    goodToGo="true"
    />

</mx:Application>

4. Then I tried to use the "htmlText" component within one of my
ActionScript classes. The class is a component that represents the contents
of an AMF object with an html string for its body. 

The result is a blank area with a small white bar extending full width on
top and an inactive vertical scroll bar on the right. The rest of the area
is transparent. (screenshot attached) The white bar at the top appears to
be a text box and I can use the mouse to create a selection in it, but it
appears to just contain blank space. When I output the text property of the
htmlText object, it gives me the filtered html that I expect.

Code used to ad htmlText to my component:

//the body and filter class are initialized 
body = new htmlText();
filter = new htmlFilter();
body.cssFile = "css/html.css";  
body.percentWidth = 100;
body.percentHeight = 100;
body.goodToGo = true;
body.text = filter.filterContent(node.body);
contentRow.addChild(body);  //add to my layout

Some of the things I have tried while troubleshooting:

1. Setting various combinations of the properties in the CREATION_COMPLETE
event handler, similar to the example mxml.
2. Setting the text value to the simple html snippet that works in the mxml
example I created.
3. Wrapping the htmlText in an mxml component.
4. Adjusting the text value after the component is visible.

I am using FlexBuilder in Eclipse 3.3.2 on Ubuntu Jaunty Jackalope, with
the latest flash player debug build (10,0,22,87) in Firefox 3.0.10. Flex
SDK version 3.3.0.4852.

Original issue reported on code.google.com by gospelb...@gmail.com on 11 Jun 2009 at 8:01

GoogleCodeExporter commented 9 years ago
Sorry.. My screenshot got lost in the original post.

Original comment by gospelb...@gmail.com on 11 Jun 2009 at 8:03

Attachments:

GoogleCodeExporter commented 9 years ago
Hello

do you mind posting the entire class ? (or email it to me)

And yes, the proprocessor can spit out the results into the as directory.
the ASPATH variable in the makefile (line 85, 96 or 107 depending on whether 
you say
'make release', 'make profile' or 'make debug') specifies what directory it all 
goes
into.

I would recommend using 'make debug' when you are still developing your app, as 
that
means debug stuff is enabled....

....

Original comment by delfick...@gmail.com on 12 Jun 2009 at 4:05

GoogleCodeExporter commented 9 years ago
Here is the class and its super class. I also attached a sample node. It is the 
a web
service response from Drupal AMFPHP, but you could just paste in values as 
constants
if you are wanting to try the class out somehow. 

The instance of DefaultScreenDisplay is created in a factory class and then 
added to
a canvas in the main application mxml.

Original comment by gospelb...@gmail.com on 12 Jun 2009 at 6:32

Attachments:

GoogleCodeExporter commented 9 years ago
hmmm, I can get it to work for me.

I've attached the files I've used.
Unzip them somewhere and run "mxmlc -use-network=false main.xml"
(the -use-network=false is so that it has permission to acess the css files. I'm
going to assume you're aware of alternative ways of giving flash this 
permission, if
not feel free to ask :))

Then run the resulting .swf and see if it works.
I've attached a screenshot of what I get.

Original comment by delfick...@gmail.com on 13 Jun 2009 at 5:38

Attachments:

GoogleCodeExporter commented 9 years ago
OK.. your example worked for me as well... I guess I've got some work to do to 
figure
out why my app is munging things somehow.

Original comment by gospelb...@gmail.com on 16 Jun 2009 at 8:51

GoogleCodeExporter commented 9 years ago
ok then.

good luck :)

Original comment by delfick...@gmail.com on 17 Jun 2009 at 2:25

GoogleCodeExporter commented 9 years ago
I've tried to check out the code using RapidSVN, but I am unable to.  I either 
get 
Error: Error while performing action: URL 'http://flex-
htmlfilter.googlecode.com/svn/trunk/flex-htmlfilter-read-only' doesn't exist

or 

Error: Error while performing action: Server sent unexpected return value (403 
Forbidden) in response to PROPFIND request for '/svn/trunk/base/com/htmlFilter'

if I try to use what looks like a valid url based on browsing the repository.

Please help.  Thank you!

Original comment by dstew...@gmcps.com on 11 Aug 2009 at 6:53

GoogleCodeExporter commented 9 years ago
svn works for me.

I suggest emailing google about the problem.

Original comment by delfick...@gmail.com on 12 Aug 2009 at 7:24

GoogleCodeExporter commented 9 years ago
am I required to have a cssFile defined in <htmlText>??  I thought I can just 
use the default values defined in that class.... But when I run the 
application, the HTML text I passed to the component shows up as blank with a 
verticle scrollbar on the right.

Original comment by LazerWon...@gmail.com on 13 Apr 2011 at 3:46

GoogleCodeExporter commented 9 years ago
It should work. Does it work if you do have a cssFile?

Original comment by delfick...@gmail.com on 13 Apr 2011 at 5:05