Flash components Flash files Utilities

Flash to MySQL + Dynamic DataGrid

$8.00
By purchasing and downloading this license, you are entitled, as buyer, to use the product in ONE SINGLE NON- COMMERCIAL PROJECT - details
ID: 1772 | Views: 1387 | Downloads: 1
Or

morethomashimself
Uploaded By: thomashimself Author
Hello Flash developers.

So I have developed the Bend class. Why is it called Bend ? Because that’s what it does. It “bends” the space between Flash -> XML -> Php -> MySQL so that Flash and MySQL are now closer to eachother. Of cource as time passed, I modified this class so now you can actualy display the results dinamicly into a dataGrid. I have used this for about 1 year now and I must say it is amayzing … that’s why I decided to share this wonderfull class with you.

So this will make your life so much easier. Finaly a shortcut from Flash to MySQL, for all those of you who are not familiar with PHP and XML .

It is as simple as this:

import Bend.*//Import this class
var query:bend = new bend() //Declare a new instance of bend
query.run(“SELECT * FROM products”,`YES`);//Run your string
query.addEventListener(“EXECUTED”, doQuery);//Listen for the query to finish


Now when the query has finished executing, you have acces to these variables:

query.wide -> Number of columns
query.deep -> Number of rows (nr. of results)
query.cnames[wide] -> Array with the column names of your query
query.datas[wide,deep] -> Matrix with all the results of your query
query.returned -> The XML result returned by your query


Isn’t that wanderfull

WAIT …. I’m not finished

What if you need to display the data in a dataGrid. Well that’s easy.

var myDataGrid: DataGrid = new DataGrid(); //Declare your new dataGrid
myDataGrid = query.buildDatagrid(x, y, width, height);//Assign the query results to it
addChild(mDataGrid);//Add it to the stage


You now have a fully functional dataGrid. How simple is that ?

You want more ? You GOT IT

Have you noticed the “YES” from query.run(“SELECT * FROM products”,`YES`) ? Well this can also be “NO”. That variabile is called expectResults and that’s exactly what it means. So if you use SELECT , then you’ll use “YES” because you are waiting for some results to return in Flash. But what if you want to use INSERT ? Well then you use “NO”, and you now have the value “query.insertID”, witch is the new value of your auto_increment field (the value of that inserted row). Very usefull for large scale applications with multiple users.

Ofcource you can use any SQL command. UPDATE , ALTER and so on. If that command runs in MySQL then it will run here too.

First off all here are the requirements. If you do NOT have these, then you cannot use this class.

1) Web server and/or something that can run PHP5 scripts
2) MySQL database
3) AND most important: You must have a basic knowledge of MySQL and webServer configuration, also must know about crossdomain.xml and the flash’s security sandbox policy for online use.

You can get 1) + 2) and more, by using XAMPP (google it if you don’t know what it is). And also you can get Toad for MySQL to help you with your querys. Both of these are freeware.

WARNING : This class is to be used for developing purposes only. No security measures have been implemented, in any way. That’s your problem NOT mine.

ASK Ask a question & Live a coment (Public)

more

Do you have any comment or questions about thomashimself file?


Please register & login before you post!

Start $1

        Flash files, Flash components

  Sell & Buy Flash

affiliate programm 10%

bonus system

bonus system

Login or Email Password  (Forgot?)

Details

Uploaded: 24 June 2009

Opens With: Flash CS3 (9+)

Files Included: FLA, AS, PHP, DOC, DOCX

Size: 55.7kb

Action Script: AS3

Resolution: N/A

Documentation: good

Keywords: mysql,  php,  xml,  flash,  as3 dynamic,  datagrid,  

Do you like this file?