crosswaystudios
08-08-2008, 06:08 PM
ok - I had gotten a little help from a Platform Evangelist at Adobe (Ryan Stewert) on this issue - now I can't get in touch with him... I am a noob to AIR 1.1 and Flex and I am totally confused as to why this is not working the way it should be...
Now with that outta the way - here is what I wanna do... I have several canvas contained in a viewstack. In these canvas, I have a combobox control that I want to display prepoulated data that is contained in an sqllite database. This data is in a table and in it's own column. Now my issue - I get the listing of [object binding] inside the combobox when I debug the app... The code for the SQL is of course AS3 - and is as follows:
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import flash.events.SQLEvent
import mx.rpc.events.ResultEvent;
import flash.data.SQLResult;
import flash.data.SQLConnection;
import flash.filesystem.File;
import flash.data.SQLStatement;
import flash.data.SQLConnection;
private var conn:SQLConnection;
private var dbFile:File;
private var createStmt:SQLStatement;
private var selectStmt:SQLStatement;
private function init():void
{
var dbFile:File = File.applicationStorageDirectory.resolvePath("tagData.sqlite");
conn = new SQLConnection();
conn.addEventListener(SQLEvent.OPEN, openSuccess);
conn.addEventListener(SQLErrorEvent.ERROR, openFailure);
status = "Opening database";
conn.openAsync(dbFile);
}
private function openSuccess(event:SQLEvent):void
{
conn.removeEventListener(SQLEvent.OPEN, openSuccess);
conn.removeEventListener(SQLErrorEvent.ERROR, openFailure);
}
private function openFailure(event:SQLErrorEvent):void
{
conn.removeEventListener(SQLEvent.OPEN, openSuccess);
conn.removeEventListener(SQLErrorEvent.ERROR, openFailure);
status = "Error opening database";
trace("event.error.message:", event.error.message);
trace("event.error.details:", event.error.details);
}
private function manComboQuery (event:SQLEvent):void
{
var q:SQLStatement = new SQLStatement();
q.text = "Select ManufacturerName FROM Manufacturers"
q.sqlConnection = conn;
q.addEventListener(SQLEvent.RESULT, manQueryResult);
q.addEventListener(SQLErrorEvent.ERROR, manQueryError);
q.execute();
}
[Bindable]
private var result:ArrayCollection
private function manQueryResult (event:SQLEvent):void
{
var r:SQLResult = SQLStatement(event.currentTarget).getResult();
result = new ArrayCollection;
}
private function manQueryError (event:SQLErrorEvent):void
{
trace("BREAKER");
}
]]>
</mx:Script>
Can someone please help me with this issue...
Now with that outta the way - here is what I wanna do... I have several canvas contained in a viewstack. In these canvas, I have a combobox control that I want to display prepoulated data that is contained in an sqllite database. This data is in a table and in it's own column. Now my issue - I get the listing of [object binding] inside the combobox when I debug the app... The code for the SQL is of course AS3 - and is as follows:
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import flash.events.SQLEvent
import mx.rpc.events.ResultEvent;
import flash.data.SQLResult;
import flash.data.SQLConnection;
import flash.filesystem.File;
import flash.data.SQLStatement;
import flash.data.SQLConnection;
private var conn:SQLConnection;
private var dbFile:File;
private var createStmt:SQLStatement;
private var selectStmt:SQLStatement;
private function init():void
{
var dbFile:File = File.applicationStorageDirectory.resolvePath("tagData.sqlite");
conn = new SQLConnection();
conn.addEventListener(SQLEvent.OPEN, openSuccess);
conn.addEventListener(SQLErrorEvent.ERROR, openFailure);
status = "Opening database";
conn.openAsync(dbFile);
}
private function openSuccess(event:SQLEvent):void
{
conn.removeEventListener(SQLEvent.OPEN, openSuccess);
conn.removeEventListener(SQLErrorEvent.ERROR, openFailure);
}
private function openFailure(event:SQLErrorEvent):void
{
conn.removeEventListener(SQLEvent.OPEN, openSuccess);
conn.removeEventListener(SQLErrorEvent.ERROR, openFailure);
status = "Error opening database";
trace("event.error.message:", event.error.message);
trace("event.error.details:", event.error.details);
}
private function manComboQuery (event:SQLEvent):void
{
var q:SQLStatement = new SQLStatement();
q.text = "Select ManufacturerName FROM Manufacturers"
q.sqlConnection = conn;
q.addEventListener(SQLEvent.RESULT, manQueryResult);
q.addEventListener(SQLErrorEvent.ERROR, manQueryError);
q.execute();
}
[Bindable]
private var result:ArrayCollection
private function manQueryResult (event:SQLEvent):void
{
var r:SQLResult = SQLStatement(event.currentTarget).getResult();
result = new ArrayCollection;
}
private function manQueryError (event:SQLErrorEvent):void
{
trace("BREAKER");
}
]]>
</mx:Script>
Can someone please help me with this issue...