[Flashcoders] Variable scope with asynchronous SQL connection

2011-04-20 Thread Mattheis, Erik (MIN-WSW)
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

[Flashcoders] Flash writing/reading database on MS SQL server

2011-04-20 Thread Cor
Hi List, I am looking for a way to read/write to a database in a MS SQL server. What do I need to do? What is the best approach? Do I need server side scripting, PHP or ASP? Is there anyone who can help me with a little example? TIA! Regards Cor ___

Re: [Flashcoders] Variable scope with asynchronous SQL connection

2011-04-20 Thread Henrik Andersson
Mattheis, Erik (MIN-WSW) skriver: 1. The SQLConnection is asynchronous. Is there a possibility the function variable sql would get garbage collected before the event handler fires? It is a local variable. Yes, it is up for garbage collection the instant the function returns. So if the

Re: [Flashcoders] Variable scope with asynchronous SQL connection

2011-04-20 Thread Ross Sclafani
the problem you may run into if you call in a loop is overwriting the object property. i would implement a queue: /// private var statementQueue:Vector.SQLStatement = new Vector.SQLStatement(); public function getDayOfDrill() : void { var sql:SQLStatement = new SQLStatement();

Re: [Flashcoders] Flash writing/reading database on MS SQL server

2011-04-20 Thread Mattheis, Erik (MIN-WSW)
I use Flash remoting with ColdFusion. There's examples for many server side scripting languages that come up when searching for flash femoting as3 [your preferred server thing]. On 4/20/11 2:31 PM, Cor c...@chello.nl wrote: Hi List, I am looking for a way to read/write to a database in a MS

Re: [Flashcoders] Variable scope with asynchronous SQL connection

2011-04-20 Thread Mattheis, Erik (MIN-WSW)
Thanks Ross, I was rewriting things along the lines of your example after reading Henrik's reply. On 4/20/11 2:53 PM, Ross Sclafani ross.sclaf...@gmail.com wrote: the problem you may run into if you call in a loop is overwriting the object property. i would implement a queue:

[Flashcoders] Test if class is attached to document or symbol?

2011-04-20 Thread Micky Hulse
Hi, I was just curious if there is a neat way to test if a class has been attached as a document class or if it has been attached to an object (i.e. library symbol). I am trying to kick the dust my AS3 braincells here... For some reason I can't think of a good way to do this. My goal: 1.

Re: [Flashcoders] Flash writing/reading database on MS SQL server

2011-04-20 Thread Karl DeSaulniers
Hi Cor, There a lot of easy to implement php scripts out there. That is what I use. PHP and MySQL. But here is a simple connection script for php to MSSQL for you to try if you'd like. Have not tested myself. FYI. http://www.jonasjohn.de/snippets/php/mssql-example.htm Best, Karl On Apr

[Flashcoders] Re: Test if class is attached to document or symbol?

2011-04-20 Thread Micky Hulse
On Wed, Apr 20, 2011 at 5:31 PM, Micky Hulse mickyhulse.li...@gmail.com wrote: Sorry if simple one... I am sure I am overlooking a good/easy solution here. :) Ah, this works: https://gist.github.com/933493 Specifically: public static var CLASS_REF:Class = Test; ... if (this.root is

Re: [Flashcoders] Test if class is attached to document or symbol?

2011-04-20 Thread Mattheis, Erik (MIN-WSW)
Put a function in your document class and check if the function is defined? try { myDocumentClassFunction(); // must be your document class catch { // must not be your document class } On 4/20/11 7:31 PM, Micky Hulse mickyhulse.li...@gmail.com wrote: Hi, I was just curious if

Re: [Flashcoders] Test if class is attached to document or symbol?

2011-04-20 Thread Micky Hulse
Hi Erik, thanks so much for your help, I really appreciate it. :) On Wed, Apr 20, 2011 at 6:48 PM, Mattheis, Erik (MIN-WSW) ematth...@webershandwick.com wrote: Put a function in your document class and check if the function is defined? Hmm, sorry, I might not have explained things too well. I