Professional Documents
Culture Documents
SQLStatement;
import flash.errors.SQLError;
import flash.events.Event;
import flash.events.SQLErrorEvent;
import flash.events.SQLEvent;
import flash.events.TimerEvent;
import flash.filesystem.File;
import flash.utils.Timer;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.utils.ObjectUtil;
import org.osmf.events.TimeEvent;
// function we call at the begining when application has finished loading and bulding itself
// method that gets called if we recive some resaults from our sql commands.
//this method would also get called for sql statments to insert item and to create table but in this case sqls.getResault().data would be null
private function resault(e:SQLEvent):void
{
// with sqls.getResault().data we get the array of objects for each row out of our database
var data:Array = sqls.getResult().data;
// we pass the array of objects to our data provider to fill the datagrid
dp = new ArrayCollection(data);
}