Groups | Blog | Home
all groups > flash data integration > june 2007 >

flash data integration : Send and receive data from mysql.



onelotusguy
6/18/2007 12:28:16 AM
I would like flash to send and receive data from mysql.

To send data I would like to create 5 input fields, and then use a submit
button.

Then to retrieve the data I would like to use the data grid or a dynamic text
field.

How would I accomplish this?
MotionMaker
6/19/2007 3:37:18 PM
Which one?
Flash 8 AS2
onelotusguy
6/20/2007 8:24:52 PM
MotionMaker
6/21/2007 12:00:00 AM
In Flash 8 you can use either the XML.sendAndLoad or the LoadVars.sendAndLoad
methods from their respective classes XML and LoadVars. Just your choice on the
PHP side whether you like to deal with XML or URL variables.

The shell examples are excellent with the Flash help. You just need to provide
your own PHP script:


http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?con
text=LiveDocs_Parts&file=00002879.html#wp518030

http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?con
text=LiveDocs_Parts&file=00002336.html#wp292432

Then in either class's onLoad method, you can populate the controls as you
have designed.

There are plenty of examples on the Internet.
I have a few such as

http://www.hosfordusa.com/ClickSystems/courses/flash/examples/XMLPHPMySql/Ex01/X
MLPHPMySQLEx01_Doc.php
onelotusguy
7/1/2007 11:58:29 PM
Questions On XMLPHPMySQLEx01_Request.fla.

1. On the DataGrid under the Schema you added code, how can I view what you
did?

I pulled this line from line 69(output_txt.htmlText += "------" +
xmlData_xml.firstChild.childNodes[0].childNodes[0].nodeName )

2. How does the xmlData_xml.firstChild.childNodes[0] relate to the php?

This how I see it THe firstChild.childNodes is saying look with in the
echo"<user>"
Is this correct?
And the last set of instructions is say(childNodes[0].nodeName) look with in
"echo '<sequence>'"

Am I correct on this?




MotionMaker
7/2/2007 12:00:00 AM
You return XM, then Flash parses it into an
http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?con
text=LiveDocs_Parts&file=00002862.html#wp509029 object. Flash XML and
http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?con
text=LiveDocs_Parts&file=00002883.html#wp519615 class to navigate to the node
you want.

Many folks look for a tool to convert the XML in Flash to an object with tree
nodes to make it easier to use.






<datapacket>

<response>'
<stats querySeconds = "1234">
<code>1</code>
<message>Success</message>
</response>
<users>
<user>
<sequence>1</sequence>
<id>12</id>
<firstname>grizzly</firstname>
<lastname>bear</lastname>
<email>grizzly@mountaincaves.com</email>
</user>
<user>
<sequence>2</sequence>
<id>13</id>
<firstname>yoggi</firstname>
<lastname>bear</lastname>
<email>yoggi@park.com</email>
</user>
</users>
</datapacket>
onelotusguy
7/2/2007 11:51:56 PM
On line 123 were you move the data to the output_txt, Is their a way I can
singal out the individual Data comming in?


example If I wanted to Just the see Id in one text box and the first name in a
second box.

Guy
AddThis Social Bookmark Button