|
|||
|
HI,
I am having a problem with using My SQL database with SWFkit pro. (01) I'm using swfkit with flash cs3, and I have attached swfkit project to my FLa project. Nothing wrong in it. database connection is ok too.. I can insert data into database as well. but it is possible to retrieve data from database as mentioned bellow? var rs = new ActiveXObject("ADODB.Recordset"); rs.Open("SELECT MAX(playerID) FROM playerinfo", conn, 1, 2); rs.moveFirst(); playerIDtext.text=rs.Fields(0).Value; Note : in here what I'm trying to expect is to display the maxium value of playerID column in the playerinfo database. this seems to be not working. Please help me on identifying the problem. (02) If this is not the right method in "retrieving" data, what is the best method to retrive database data using swfkit inside flash? |
|
|||
|
The "Fields" property of the rs object is another activex object, so you cannot use the syntax rs.fields(0) as in ffishscript. Please try the following code
Code:
playerIDtext.text = rs.Fields.item(0).Value; |
|
|||
|
hi,
Thank you for your reply. I fixed the problem using scripting in SWF pro in itself. Now it is working. (1) any how I tried your method as well. it is not working properly. Cannot figure out why is that. (2) I have the database connetion, data retrieving in FFish scripts. All are working well. I am passing retrieved values to flash using the code : FlashPlayer.setVariable("_root.win1.text" , ball1Count.toString()); this works fine. But the problem is when I want to set variable value in action script, it is not working. //---Action Script Code---// var test; FSCommand("FFish_Run", "database"); FSCommand("FFish_Run", "count"); ... ... // FFish script ------------// FlashPlayer.setVariable("_root.test" , "100"); But the variable "test" is always 'undefined' . Please help me with this issue. Thank you. |
|
|||
|
The reason is that the fscommands are asynchronous. The fscommands just tell the flash player that a command needs to be executed. The flash player just puts these commands into something like a queue, and goes to the next line of your actionscript. It only begins to execute the commands when it has finished all the actionscript code.
If you want to avoid this problem, please use the wrapper class of swfkit instead. Code:
import SWFKit.*;
Global.invoke("database");
|
![]() |
Was this information helpful? Yes No
| Tags |
| database, my sql |
| Thread Tools | |
| Display Modes | |
|
|