Skip to main content
Participating Frequently
July 6, 2009
Question

bloody hell RTL

  • July 6, 2009
  • 1 reply
  • 10119 views

Hi

Im evaluating the flash cs4 IDE for my company for its new text layout RTL feature.

Ive been tring to implement a simple RTL text component with no success.

The only reason i am tring flash CS4 is for its RTL feature.

Please can someone give me a simple one liner example for implementing RTL in a TextLayout component (using actionscript 3 with flash CS4 - no flex!).

Thnx

Dotan

This topic has been closed for replies.

1 reply

Adobe Employee
July 6, 2009

At this point I'd recommend not using the flash cs4 component that was posted last November.  Better would be to get the weekly build from labs and then directly add textLayout.swc to your project as a library.  All of the examples in the actionscript directory (included with the build) can be built with Flash CS4 and do not use Flex.

I'd recommend the ImportMarkup.as example.  Modify the markup to include RTL content and add an EditManager.  Add direction="rtl" to the TextFlow element.  Sorry its not one line.

There are known problems in FlashPlayer 10 with the IMEs and various languages.  Check the release notes for details.  Player team is working on adding IME support in the player.

Hope that helps,

Richard

dotmixAuthor
Participating Frequently
July 7, 2009

Ive done it!

I got it to go RTL in one line +/-.

For all you out thare googling it here is a simple way:

1. add a TextLayout component the stage (lets name it myTextLayout).

2. in actionscript 3:

      myTextLayout.xmlText="<?xml version=\"1.0\" encoding=\"utf-8\"?>"+
                "<flow:TextFlow xmlns:flow=\"http://ns.adobe.com/textLayout/2008\" >"+
                    "<flow:p direction=\"rtl\">אחת two שלוש</flow:p>"+
                  "</flow:TextFlow>";

This works like a charm!

I have some more questions:


1. how do i access the "p" node (from the example above) with actionscript. is there a getElementById for this.

2. whare can i the API Reference for the XML (what kind of elements are there, what do thay do and what properties thay have).

thanx

dotan

Adobe Employee
July 8, 2009

Note this all applies to more recent builds than the original Flash CS4 extension.

There is a TextFlow.getElementByID function.

Docs are available here:

http://livedocs.adobe.com/flex/gumbo/langref/

I couldn't find a doc with the complete list of tags though it must be posted somewhere.  This should be useful to other folks as long as they get past the subject of the post.

Here's a list and the class they map to.

TextFlowTextFlow
divDivElement
pParagraphElement
tcyTCYElement
aLinkElement
imgInlineGraphicElement
brBreakElement
tabTabElement
spanSpanElement
formatTextLayoutFormat
linkNormalFormatTextLayoutFormat
linkHoverFormatTextLayoutFormat
linkActiveFormatTextLayoutFormat

For the suported attributes check out the TextLayoutFormat class.  Also id and styleName are supported.

Note that format elements may only be a child of a TextFlow and need to have an id property.   To refer to a named format use format="idname" on a element.  The link*Format tags are for specifying how LinkElements appear in different states.  They cascade to children when specified on parent elements.

Richard