Reputation: 3
I want to add Arabic text using AS3. But the problem I am facing is that once I assign text to textfield, the text gets reversed. Is there any way by which I can get this thing done. If there is any SWC that is required, please send me the link to that too.
Upvotes: 0
Views: 118
Reputation: 3871
You can use the TLFTextField
var tlf:TLFTextField = new TLFTextField();
tlf.defaultTextFormat = new TextFormat( "arialArabic" );
tlf.antiAliasType = AntiAliasType.ADVANCED;
tlf.direction = flashx.textLayout.formats.Direction.RTL;
tlf.text = "هلو ورد!";
Or if you need to use the standard TextField
then you'll need to look into using a library like the one below to correct the text :
https://github.com/SaffronCode/UnicodeRTL
eg:
textField.text = UnicodeStatic.convert("هلو ورد!");
Upvotes: 1