ActionScript 2: Bugfixes in “ActionScript 2.0 Arabic Parsing v1.2”

Update 2010-04-26: I’ve also fixed the problem, that Latin characters at the beginning are ignored (see ActionScript 2: Bugfixes in “ActionScript 2.0 Arabic Parsing v1.2” – Part 2).

I’ve just reviewed the new version 1.2 of the “Arabic parser” for ActionScript 2. Among some bugfixes, the library now adds a rudimentary support for arabic input fields. The bugs I have found in version 1.1 (see my post “ActionScript 2: Create dynamic text fields with Arabic texts”) are all fixed with the new version.
Altogether, the new version works quite good but I found (and fixed) the following three bugs:

  1. Bug 1: If the last two or more words only contain Latin characters this words are not rendered in correct order.
  2. Bug 2: Brackets, punctuation marks or other non-Latin characters that are connected at the end of a Latin word get lost.
  3. Bug 3: If the text field does not embed the font the characters are ordered in the wrong way.

I’ve modified the original example for arabic parsing 1.2 (http://ixd-consultant.com/blog/2010/03/26/actionscript-2-0-arabic-parsing-v1-2/) to demonstrate the problems (download):

Get Adobe Flash player

The example above shows that

  • “HELLO WORLD” is not rendered in correct order,
  • the closing brackets are missing, e.g. on the right side of “Loch Ness monster” and
  • after clicking “toggle embed” all characters are shown in wrong order.

I fixed the bugs in the class com.xvisage.utils.StringUtils and republished the example. The result looks as follows (download):

Get Adobe Flash player

In the above example there are still problems when the font is not embedded: A few characters are not rendered properly, e.g. in the second line the word on the right side of the brackets containing “plesiosaurs”. Curiously selecting the characters with the mouse fixes the problem (can be tested in the above example). Imho, this could be a bug in the Flash player and not an issue caused be the arabic parser.

Here are the download links for the examples above (Flash CS3):

Comments

  1. piyush joshi

    Hey Jons.

    I found your code very helpful and really very elegant but it problems with Flash-8.
    can you please let me know what the problem is, why it is showing correct output with CS4 but not showing in Flash – 8.

    I can see the output in flash 8 but thats not what I am getting in CS4 and other.

    why this problem. and what changes will be required to concur this problem. seeking for your help ASAP.

    Your advice may help.

    thank you in advance

    Piyush Joshi

  2. Jan Jonas

    Hey. Thanks for your comment. Do you use the most recent version of the “ActionScript 2.0 Arabic Parsing” library (http://ixd-consultant.com/blog/2010/07/12/open-source-arabic-parsing-v1-5/)? Have you an example fla file or a code snipped to reproduce your problems?

Leave a comment

Your email address will not be published. Required fields are marked *

*