This incredibly simple tool takes 5 minutes to set up and allows you to run mySQL queries and return results to flash using Actionscript 2 just as you can in PHP or any other language. Just 3 lines at the top of your flash document make mySQL queries a single function call away. You can loop through the results, trace them all to the output panel and even display them in a datagrid (a flash table) on the stage.
Check it out, easy as pie:
mysqlQuery("SELECT * FROM newsdemo", onQueryComplete)
The onQueryComplete parameter is your own function to run after results are returned. Click image below for full examples with notes & instructions:
Included:
flashconnect.php: A php file which gets the database results and sends them to flash
mysql2as.as: The main function library for this package
mysql2as.fla: Flash CS3 project with full demos and comments
Instructions.txt: Simple step by step setup instructions.
You will need:
Basic-Intermediate knowledge of actionscript 2.0
PHP enabled web server with a mySQL database already set up (tutorial here)
connect.php: A php file on your server which connects to your database. (tutorial here)
Buy using PayPal for USD$9:
Licence:
$9 for use on unlimited commercial or personal projects.
Disclaimer:
Flash loadVars is not particularly secure. I would not advise sending sensitive information via this package and I am not responsible for the security of your data.
17 comments:
One other feature that I didn't mention above:
You can get the last inserted auto ID after an INSERT statement by adding another parameter to your onQueryComplete function like so:
function onQueryComplete(resultsArray, lastInsertID){
traceSQL(resultsArray)
trace("If you ran an INSERT statement, the last auto ID added to database was: "+lastInsertID)
}
Cron, I love that you are sharing this with us. I hope that someday I will understand what you are talking about...
Works well! Thanks a mill!
Thanks Cron, It's real easy to use and works seamlessly - kudos for the effort put into this.
can I use it in order to develop a flash website backend? I want to retrieve videos URL, images and modify text ?
Yes, It can be used for this. You must have a knowledge of mySQL to use it tho. You need to have a database up and running before you can connect it to from flash.
Hello!!!
How to include variables in query string??
It's possible??
Thanks
If by query string you mean the php script path, then yes, as far as I know flash has no problem sending GET variables to php in this way.
Hello Cron...
I said variables in AS2 i do this and is working fine:
//USAGE:::::::::
mysqlQuery("SELECT users.username,users.`password`,users.sugar_id,users.email FROM users WHERE users.username = "+user1, onQueryComplete);
Thankz a lot
Hello...
When i use LOOP THROUGH RECORDS, if a table field is empty the script change the position of the fields and the data in flash layout is on another field, for example the field "name" is filled with "id"...?
Can you help me wuith this...? Thanks in advanced
Hello Cron Merry xmas...
How to use UPDATE with this script??
It's possible??
Thankz
Yes, UPDATE or any other type of query should work just fine. Merry xmas to you too!
Regards blank records causing offset problems - I will look into this when I get a chance but it might be a while before i can get around to it.
I have had a look at blank records causing offset problems and I cant find any bugs. Everything is working normally.
https://isocialhub.net/american-express-credit-card-generator/
Wonderful web site. Plenty of useful info here. I am sending it to a few friends ans also sharing in delicious. And obviously, thank you in your effort! There are wonderful blogs as yours on instagram, please coming site webstagram to know more.
wonderful blog. it is very good instruction and an example of the image. which are good run programming languages. whatsapp mod
The ranges present a tough outcome of between 90% to 160% (200% for skilled players). A scatter is a pay mixture based mostly on occurrences of a chosen image landing anywhere on the reels, quite than falling in sequence on the identical payline. A scatter pay usually requires a minimum of three symbols to land, and the machine could provide increased prizes or jackpots depending on the 배당 토토 number that land. Scatters are regularly used to trigger bonus games, such as free spins .
Post a Comment