I am devloping an editor with spell check feature in Flex + AIR using Sqlite as an embedded database.
In database I have a table with the words. The table contains lacs of words. I have written the code to search for the word in table. I have used the sync method for all this. This pauses my application while searching.
I would like to use async method to stop application pause.
The code for Search word is as follows:
public function searchInDictionary(word:String):Boolean
if(word == "")
connection= new SQLConnection();
var query:SQLStatement = new SQLStatement();
query.sqlConnection = connection;
query.text = 'SELECT id FROM tbl_'+ CommonLanguageCode +' WHERE word LIKE "'+word+'"';
connection.open( dbfile,SQLMode.READ );
connection.open( dbfile );
var result:SQLResult = query.getResult();
if( result.data == null )
var numRows:uint = result.data.length;
If this function returns false(word not found) then i have to call the function to to red underline that word.
Please suggest me if I am going wrong. As I am using Sync method & it takes some milli seconds to search a word. & if I am wrting a paragraph then it makes my application sluggish.
Is there any other way I can store the words & search more fastly. If yes then please et me know.
Thanks in advance.