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, 4 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.

Spread the Good Word:
  • Digg
  • del.icio.us
  • Facebook
  • NewsVine
  • StumbleUpon

, , ,

  1. No comments yet.
(will not be published)