arthurchad - 2013-02-24

A helper class that allows you to open a database file and run a select, update, delete or any valid sql command against the file in two lines of code. No need to

worry about the event handlers and opening the connection properly or creating the SQL statement object etc.

I'm assuming you know the basics of actionscipt, packages and SQL.

1)Extract "SQLITE_AS_HELPER.zip" and place the the com folder where your fla file is.

2)In your actionscript import the package using:
import com.uss.db.*;

3)The following methods should be of most interest:
SqlDb(db:String) --The contructor, here you must pass the file name of your datbase.
the class will assume your db file lives in the application directory

runSQL(sql:String) -- This method will run the sql string you pass in on the database
you selected in the constructor.

4)The following properties should be of most interest:
traceEnabled:Boolean -- This property specifies if you would like the class to trace
the results of your commands etc. to the output window in flash

resultObject:Object -- After a select statement this object gets populated with the
with the results returned by the select statement.

Example Usage:
import com.uss.db.*;
var usersDB:SqlDb = new SqlDb("users.db");// Opens the users.db file for reading and writing.
usersDB.traceEnabled = false;//Disables tracing to the output window.
usersDB.runSql("Select * from test");//Runs a select to return all rows in the 'test' table
trace(usersDB.resultObject[0].name);//Traces the column named "name" in the first row returned by the select statement