AIR版的通讯簿(五)

脚本部分(1)

<mx:Script>
  <![CDATA[
   import mx.controls.Alert;
   import view.ContactsConst;
   [Embed(source='assets/images/contact32.png')]
   [Bindable]private var img:Class;
   private var conn:SQLConnection;//数据库连接
   private var createStmt:SQLStatement;//数据库连接状态

   private  var sqlArray:Array=new Array();
   private function init():void{

    createSql();
    var dbFile:File=File.applicationStorageDirectory.resolvePath(ContactsConst.DB_FILE_NAME);
    conn=new SQLConnection();
    conn.addEventListener(SQLEvent.OPEN,openHandler);
    conn.addEventListener(SQLErrorEvent.ERROR,errorHandler);
    conn.openAsync(dbFile);
   } 

]]>

</mx:Script>

你可能感兴趣的:(AIR版的通讯簿(五))