Flex and Flash with Zend

In order for this tutorial to work, you need to make sure that your environment is setup by following the instructions located here. I have included an fla (cs3) file in the /Flash folder of the Flex project archive. You would not normally do this for a production project but this is just meant to be a simple example and since they both use the same php files it didnt make much sense to split this article up into two separate articles.

I am currently using Flex Builder 3.0.2 and Flash CS4 but I saved the fla as a cs3 file for those that don’t have it yet.

Code and instructions after the jump

  zendDbFlex.zip (859.8 KiB, 106 hits)

  1. The first thing you are going to want to do is download the file and import the project into Flex using File > Import > Flex Project > Archive File.
  2. After that is done you will want to create a database called zenddbflex using PHPMyAdmin.
  3. Run the sql script ‘Table.sql.txt’ located in the sql folder of the Flex project against your zenddbflex database to create the products table.
  4. Create a folder under your ‘wamp\www directory’ called ‘zendDbFlex.’
  5. Copy the gateway.php file and the ZendData.php file from the ‘php’ folder in your flex project into the ‘wamp\www\zendDbFlex’ folder you just created above.
  6. In ZendData.php, modify this line to change the user/password if you are using a different combination
    mysql_connect("localhost","root","");

    .

  7. Run the Flex project or the fla file in Flash and you should see 4 products output into the text area!

I realize I skipped some steps by not talking about db creation etc in PHPMyAdmin but there are plenty of tutorials on that. If you do have any questions or I missed a step, please comment below.

    • nithya
    • October 3rd, 2010

    Hi I am getting this error will you guide me

    • nithya
    • October 3rd, 2010

    Hi I am getting this error, guide me on this

    Unhandled NetStatusEvent:. level=error, code=NetConnection.Call.BadVersion

    • Can you post your files somewhere? Unfortunately you don’t get the best error messages in doing this in Flash…

    • Leon
    • October 26th, 2010

    Hi, when i run app not getting anything. Configured the Zend framework as you mentioned and placed project data into the folder structure as you said. But not getting anything and no errors.

    • Leon
    • October 26th, 2010

    Hi, I solved the issue. Thanks dude, great work.

    • Glad you solved the issue. What was the problem/solution?

  1. No trackbacks yet.

 

Golden Eagle Coins was founded in 1974 by Robert W. Mangels

Switch to our mobile site