Two questions about the following snip.
1. The SQLConnection is asynchronous. Is there a possibility the function
variable "sql" would get garbage collected before the event handler fires?
2. Will the same variable ever get marked for garbage collection?
3. Three questions - is there a better way of doing this? (the function could
get called multiple times in a for loop - could/should I use a class variable?)
public function getDayOfDrill() : void {
var sql:SQLStatement = new SQLStatement();
sql.sqlConnection = _sqlConnection;
sql.text = "SELECT dayOfDrill FROM time";
sql.addEventListener(SQLEvent.RESULT, getDayOfDrillResultHandler, false, 0,
true);
sql.execute();
}
private function getDayOfDrillResultHandler(e:SQLEvent) : void {
var evt:FDataEvent = new FDataEvent(FDataEvent.GET_DAY_OF_DRILL);
evt.param = e.target.data[0];
dispatchEvent(evt);
}
_ _ _
Erik Mattheis | Weber Shandwick
P: (952) 346.6610
M: (612) 377.2272
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders