论坛首页 编程语言技术论坛

Flex的丰富文本处理能力实在不敢恭维

浏览 15568 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2009-09-20  
源代码没有开发!  有些不太好

我们现在是想这么搞的,对于blog部分 发布blog的富文本编辑器使用的是html中的fckediter,而现实图片时,仍然使用jsp只不过是嵌套在flex中。这样就相当于是flex与jsp结合使用来达到blog的效果! 我感觉还可以!

不过TLF可以编辑一些表格以及一些负责的东西吗?? 据我所知flex的组件显示一些复杂的html标记还是不太好的,,不知道TLF中搞的怎么样???
0 请登录后投票
   发表时间:2009-09-20  
wuxi15932077655 写道
不过TLF可以编辑一些表格以及一些负责的东西吗?? 据我所知flex的组件显示一些复杂的html标记还是不太好的,,不知道TLF中搞的怎么样???

TLF不能编辑表格,它的初衷也不是用来显示html标记的,和原来相比还是支持几个有限的html标记,只不过排版能力更强了。
用TLF来呈现完整的HTML,不太可行。只能做一些简单的HTML呈现。你可以对blog系统做一些裁剪,支持一些基本的HTMl语义,别指望TLF替你处理复杂的东西。
0 请登录后投票
   发表时间:2009-09-20  

TLF目前支持的HTML标记

 

HTML format. Use this for importing from, or exporting to, a TextFlow using the HTML fomat. The Text Layout Framework HTML supports a subset of the tags and attributes supported by the TextField class in the flash.text package.

The following table lists the HTML tags and attributes supported for the import and export process (tags and attributes supported by TextField, but not supported by  the Text Layout Framework are specifically described as not supported):

Tag Description
Anchor tag The <a> tag creates a hypertext link and supports the following attributes:
  • target: Specifies the name of the target window where you load the page.  Options include _self, _blank, _parent, and  _top. The _self option specifies the current frame in the current window,  _blank specifies a new window, _parent specifies the parent of the  current frame, and _top specifies the top-level frame in the current window.
  • href: Specifies a URL. The URL can  be either absolute or relative to the location of the SWF file that  is loading the page. An example of an absolute reference to a URL is  http://www.adobe.com; an example of a relative reference is  /index.html. Absolute URLs must be prefixed with http://; otherwise, Flash treats them as relative URLs.  Note: Unlike the TextField class, ActionScript link events  are not supported. Neither are a:link, a:hover, and a:active styles.
Bold tag The <b> tag renders text as bold. A bold typeface must be available for the font used.
Break tag The <br> tag creates a line break in the text field. Set the text field to  be a multiline text field to use this tag.
Font tag The <font> tag specifies a font or list of fonts to display the text.The font tag  supports the following attributes:
  • color: Only hexadecimal color (#FFFFFF) values are supported.
  • face: Specifies the name of the font to use. As shown in the following example,  you can specify a list of comma-delimited font names, in which case Flash Player selects the first available  font. If the specified font is not installed on the local computer system or isn't embedded in the SWF file,  Flash Player selects a substitute font.
  • size: Specifies the size of the font. You can use absolute pixel sizes, such as 16 or 18.  Note: Unlike the TextField class, you cannot use relative point sizes, such as +2 or -4.
Image tag The <img> tag lets you embed external image files (JPEG, GIF, PNG), SWF files, and  movie clips inside text fields. Text automatically flows around images you embed in text fields. You  must set the text field to be multiline to wrap text around an image.

The <img> tag supports the following attributes:

  • src: Specifies the URL to an image or SWF file, or the linkage identifier for a movie clip  symbol in the library. This attribute is required; all other attributes are optional. External files (JPEG, GIF, PNG,  and SWF files) do not show until they are downloaded completely.
  • width: The width of the image, SWF file, or movie clip being inserted, in pixels.
  • height: The height of the image, SWF file, or movie clip being inserted, in pixels.
  • align: Specifies the horizontal alignment of the embedded image within the text field.       Valid values are left and right. The default value is left.

Note: Unlike the TextField class, the following attributes are not supported: hspace, vspace,  id, and checkPolicyFile.

Flash displays media embedded in a text field at full size. To specify the dimensions of the media  you are embedding, use the <img> tag height and width  attributes.

In general, an image embedded in a text field appears on the line following the  <img> tag. However, when the <img> tag  is the first character in the text field, the image appears on the first line of the text field.

Italic tag The <i> tag displays the tagged text in italics. An italic typeface must be available  for the font used.
List item tag Note: Unlike the TextField class, the List item tag is not supported.
Paragraph tag The <p> tag creates a new paragraph. The text field must be set to be a multiline  text field to use this tag.   The <p> tag supports the following attributes:
  • align: Specifies alignment of text within the paragraph; valid values are left, right, justify, and center.
  • Note: Unlike the TextField class, the class attribute is not supported.
Span tag The <span> tag is available but supports no attributes. 
  • Note: Unlike the TextField class, the class is not supported.
Text format tag

The <textformat> tag lets you use a subset of paragraph formatting  properties of the TextFormat class within text fields, including line leading, indentation,  margins, and tab stops. You can combine <textformat> tags with the  built-in HTML tags.

The <textformat> tag has the following attributes:

  • indent: Specifies the indentation from the left margin to the first character  in the paragraph; corresponds to TextFormat.indent. Both positive and negative  numbers are acceptable.
  • leftmargin: Specifies the left margin of the paragraph, in points; corresponds  /* to TextFormat.leftMargin.
  • rightmargin: Specifies the right margin of the paragraph, in points; corresponds  to TextFormat.rightMargin.

Note: Unlike the TextField class, the following attributes are unsupported: blockindent, leading, and tabstops.

Underline tag The <u> tag underlines the tagged text.

0 请登录后投票
   发表时间:2009-09-21  
如果按照这样来说!  是不是说用flex做blog会有很多困难??


如果在页面中嵌套html页面的方式来实现博客!  你感觉怎么样??有相关的处理经验吗?
0 请登录后投票
   发表时间:2009-09-21  
wuxi15932077655 写道
如果按照这样来说!  是不是说用flex做blog会有很多困难??


如果在页面中嵌套html页面的方式来实现博客!  你感觉怎么样??有相关的处理经验吗?


如果整个应用以flex为主,用flex和iframe混合,互交互性太差,还有焦点等问题,把flash设为透明模式,界面刷新效率很低,还存在不同浏览器的兼容问题。iframe只能压在flex上面,flex组件盖不住iframe,要想做到flex和iframe无缝的混合,是不可能的(AIR环境下除外)。这种方式下,用户体验会差一些,开发起来也是比较麻烦的,不过采取何种方式,具体还是要看用户需求是什么样的,如果blog系统对于你的整个应用很重要,需要提供超强的html呈现能力,还是用iframe来的好。

对于我们的系统,blog只要能满足基本的html呈现就可以了,iframe嵌入方式虽然能提供比较强大的呈现和编辑能力,但由于和flex不能很好的无缝集成,用户体验会大打折扣,最终还是舍弃了这种方式。

如果用flex做一个和html版的不相上下的的blog系统,利用Text Engine的能力,从技术角度而言,是可以做到的(刨去性能瓶颈和内存开销),flex在这方面还有很长一段路要走。
0 请登录后投票
   发表时间:2009-11-30  
我有个问题想问一下。

就是同为输入文本框,tlf是在原有textfield上进行的封装呢,还是全新开发一个输入文本框?

两者性能有什么差距(仅对输入纯文本而言)?

前面看到你说的上w行性能较差,我在textfield试5k行的时候就能感觉到卡了,但还可以接受。
0 请登录后投票
论坛首页 编程语言技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics