Archive for November, 2006

24
Nov

Diacritics stripper (Remover) tutorial.

Posted By wassim in Flash, Flash Tutorials

Hello and salam;

I have been working onthis project for a couple of hours now and I thought I should share with you my findings since I tried searching the internet and found nothing at all in this area, what I am trying to show you is how to remove Arabic diacritics from Arabic text dynamically in Flash using ActionScript.

Now what I am about to explain is not an undocumented feature, a hidden API or some sort of a hack, it’s simply my approach to solve this problem. In fact this method will work in flash player version 5 and up.

This method for removing Arabic diacritics is based on the charCode and fromCharCode methods of the String class in ActionScript.

The thing is, all Arabic specific diacritics have an AScii char code between 1611 and 1618, Arabic characters as you might know are double bytes characters and thus each character is represented by two bytes instead of one as it is the case of latin characters.

So in pseudocode, this is how to remove the diacritics dynamically:

- start by storing all the charcodes of the input text in an Array. You will have to make a for loop for that to grab them using the charCodeAt method of the String class.

- loop through the Array and check the charcodes, if a charcode is between 1611 and 1618 just omit it, store the results in a new Array.
- loop through the purified Array and convert the charcodes back to characters using the fromCharCode method, store the results in yet a new Array.

- Finally , joing the elements of the last array and voila!

Below is a sample of the diacritics remover actionscript in action.

Diacritics Stripper

23
Nov

Version 1.4 of Quran searcher and reciter is released

Posted By wassim in Flash

Here’s a link to the newest version of Quran searcher and reciter

Changes are:
- Added a progress bar to all the preloaders in the program.
- Implemented standard windows MessageBox alerts whenever the user enters an incorrect e-mail or a blank as well as when the e-mail is submitted correctly.

22
Nov

Version 1.3.1 of Quran searcher and reciter (silent update) is released

Posted By wassim in Flash

Hello and salam;

Version 1.3.1 of Quran searcher and reciter (silent update) is released, this is a silent update (the version number remains unchanged in the about tab) as there’s only few minor bugs fixed and one feature added:

- Added a “tell a friend about this page” feature.
Note that this is the only feature that actually requires communicating with PHP…

Here’s a link to the Quran Searcher and Reciter

If you have any suggestions for futur features please use the mail the author option in the right-click context menu to report or communicate them to me.

22
Nov

Advanced Arabic support workaround for Flash.

Posted By wassim in Flash

Hello everyone,

I have been working for some time now on the development of the Quran Searcher and Reciter as you may have noticed; basically it’s an online application that allows you to search for the occurrences of a particular word in the holy Quran and to recite Quran verses or chapters.

The Quran Searcher and Reciter is a Flash 8/ActionScript 2 based application with powerful features and a very beautiful user interface.

What I would like to share with you are some of the steps and bottlenecks we had to go through in order to reach the functionality we were looking for.

- The first problem we had to deal with was that Flash lacks real support of RTF (right to left) based languages like Arabic; this had an enormous impact on and was a big setback in our work.

An example of the consequences of this lack of support is that Flash wraps Arabic sentences in a character-based manner instead of the correct word-based fashion i.e it breaks in the middle of a word and wraps the reminder of this word to the next sentence instead of taking the whole word to the next line. This was a major problem as it could change the meaning of the verse!

Facing this harsh reality, we only had one way out: coding our own multiline Arabic text wrapper.

- The second major problem was the lack of direct database connectivity, Flash cannot directly connect to and retrieve data from a database, it needs to communicate via XML and PHP with the concerned mySQL database, this was fine for us till we faced the fact that in order to allow php to send the data via XML to Flash we have to change our default php encoding which means large unpredictable mess in the other php related sides of our host. We simply had to abandon this approach and to find a way to emulate database queries in pure ActionScript.

Having that done was the biggest and most important achievement in the development of this application.

What we basically came up with is a multidimensional array storing all of our elements, this had a positive side too since flash implements zlib compression to the data embedded in the swf file which reduced the size of data we needed to be loaded and consequently the loading time of the application.

- The third problem was searching Arabic text for a particular string; the problem really jumps in when the Arabic text stored in the database-like structure of our Flash application has diacritics (tashkeel) while the search string is diacritics-free. This was also a major issue and we had to come up with a somewhat hard solution: There has to be two fields for each verse, one with and one without diacritics. The search proceeds in the diacritics-free field and returns the ID of those verses containing the search word, then the with-diacritics field having the same ID would be retrieved and displayed.

Well, I don’t want to add more line to this article as I know you tend to get bored of looong readings, I will add more in a separate post later on.

Till then, enjoy this piece of art: The holy Quran Searcher and Reciter.

21
Nov

Version 1.3 of Quran searcher and reciter is out…

Posted By wassim in Flash

Hello;

The new version 1.3 of quran searcher and reciter is out , changes are:
- Added right click context menu with most the options included in it.
- Added a mail the author feature.

This new version will be available online after a short period of testing, probably thursday novembre 23/2006.