FlarabyAS3 Documentation

In the name of Allah the compassionate the most mercifull  Who is Allah ?
May peace and Allah mercy and blessings be upon you

  • html:Boolean (get/set)
    • get: returns true if FlarabyAS3 is configured to deal with html text, or false if dealing with normal text
    • set: configures FlarabyAS3 to deal with html (true) or normal (false) text
    • default value: false
  • dir:String (get/set)
    • get: returns ‘RTL’ if FlarabyAS3 is configured to return Right-To-Left text, ‘LTR’ if FlarabyAS3 is configured to return Left-To-Right text
    • set: configures FlarabyAS3 to return Right-To-Left text (RTL) or Left-To-Right (LTR)
    • default value: ‘RTL’
  • extraCharWidth:Number (get/set)
    • get: returns current FlarabyAS3 extraCharWidth value
    • set: sets FlarabyAS3 extraCharWidth value. Generaly, values from 0.1 to 1 give suitable results
    • default value: FlarabyAS3 calculates a default value based on the font size defined in TextFormat.size

  • FlarabyAS3()
    • FlarabyAS3 Constructor
  • removeTashkeel(str:String):String
    • Removes any Tashkeel from the str. Can be used just in case str may have Tashkeel.
    • str: the string to remove Tashkeel from
    • Returns a string with Tashkeel removed, if any
  • convertArabicString(inputStr:String, width:Number, tfrmt:TextFormat):String
    • The main function in FlarabyAS3, used to render bidirectional RTL or LTR text, including Arabic, Persian, Urdu, English, French, Spanish and Italian
    • inputStr: the string to be converted
    • width: the width of the internal textField which text would be rendered
    • tfrmt: the TextFormat object that gives text its properties, like: Font name, size and alignment. A font must exist in the library with a linkage identifier to be used in TextFormat.font
    • Returns inputStr converted to a formatted string properly rendered in the swf file
  • convertArabicChar(p:Number, str:String):String
    • Converts an ASCII character (Arabic/Persian/Urdu) to a Unicode one (Arabic/Persian/Urdu) depending on its position in str
    • p: position of character in str
    • str: string/word in which the character exists
    • Returns a Unicode Arabic/Persian/Urdu character
  • isArabic(char:String):Boolean
    • Finds whether the specified character is an Arabic/Persian/Urdu character
    • char: the character to be checked
    • Returns true or false
  • isLatin(char:String):Boolean
    • Finds whether the specified character is a Latin (English/French/Spanish/Italian)
    • char: the character to be checked
    • Returns true or false
  • isDigit(char:String):Boolean
    • Finds whether the specified character is a Digit
    • char: the character to be checked
    • Returns true or false
  • isPunc(char:String):Boolean
    • Finds whether the specified character is a Punctuation. A punctuation is considered a non Arabic, Persian, Urdu, Latin or digit character including space
    • char: the character to be checked
    • Returns true or false
  • isTag(str:String):Boolean
    • Finds whether the specified string is a tag. A tag is considered any string with a “<” at the start and a “>” at the end
    • str: the string to be checked
    • Returns true or false
  • removeTags(str:String):String
    • Extracts the string part of a tagged string.
      Example:
      removeTags(“<a href=’path/to/link’>Some Link</a>”)
      returns:
      “Some Link”
    • str: the tagged string
    • Returns the extracted string, or the same string if the string is not tagged
  • getStringWidth(str:String):Number
    • Computes the width of the string str
    • Must be called after a call to convertArabicString() method
    • str: the string to return its width
    • Returns a number representing the width of str
  • getCharArrWidth(arr:Array):Number
    • Computes the width of an array of strings/characters
    • Must be called after a call to convertArabicString() method
    • str: the array of strings/characters to return their width
    • Returns a number representing the width of the array of strings/characters
  • replaceNewlines(str:String):String
    • Replaces newline characters in str
    • If html=true; or multiline=false; all newline characters (\r\n, \r, \n) will be converted to ” “
    • If multiline=true; and html=false; newline characters \r\n, \r will be converted to “\n”
    • str: the string to be replaced
    • Returns a string with newlines replaced
  • getLines():Array
    • Must be called after a call to convertArabicString() method
    • Returns an array of lines representing the converted string lines

  • direction (com.arabicode.text.Flaraby.DirEvent)
    • Fires when dir property changes
    • DirEvent.DIRCHANGE
  • extrawidth (com.arabicode.text.Flaraby.ExtraWidthEvent)
    • Fires when extraCharWidth property changes
    • ExtraWidthEvent.EXTRAWIDTHCHANGE
  • convert (com.arabicode.text.Flaraby.ConvertEvent)
    • Fires when text conversion process is finished
    • ConvertEvent.CONVERT