View Full Version : Calling from MySQL into Flash Builder

DG Kim
01-21-2012, 05:27 AM
Okay, so I've got a design from Flash Catalyst imported into Flash Builder. The design is great and all, but I need to load data from the MySQL database... that is, dynamically into a data list.

I've looked at every tutorial, and I understand what they're saying, but I really am struggling with the most basic steps! I have a list of a few problems/things I've done.

Things I've done:
1. I've installed WAMP for local debugging.
2. I've gotten the Zend framework in the wamp/www folder.

1. For some reason, my Flash Import won't find/create a Main.html to debug with. Do I need to choose the one in the original project file?
2. Where is the best place to create a new project folder? Right now, they're under Adobe Flash Builder with PHP 4.5 (or something like that). Do they need to be in wamp/www?
3. How exactly can I bind the data to parts on the data list? For example, how can I specify that a certain row from the result will go to a certain item of text? (i.e. $row['event_name'] would be in the text1 field). Here's the code for the dummy data:

<fx:DesignLayer d:userLabel="Data">
<fx:DesignLayer d:userLabel="one">
<s:List skinClass="components.DataList4" x="175" y="454">
<fx:Object image2="@Embed('/assets/images/main/Layer 23.png')" text1="Orchestra Concert" text2="CVHS Theatre" text3="Janurary 18" text4="7:00 - 8:00"/>
<fx:Object image2="@Embed('/assets/images/main/Layer 23.png')" text1="Wrestling" text2="CVHS Gym" text3="Janurary 19" text4="7:00 - 9:00"/>
<fx:Object image2="@Embed('/assets/images/main/Layer 23.png')" text1="JV Basketball" text2="CVHS Gym" text3="Janurary 20" text4="4:00 - 5:15"/>
<fx:Object image2="@Embed('/assets/images/main/Layer 23.png')" text1="Frosh Basketball" text2="Ferris Gym" text3="Janurary 20" text4="5:30 - 7:30"/>
<fx:Object image2="@Embed('/assets/images/main/Layer 23.png')" text1="Varsity Basketball " text2="CVHS Gym" text3="Janurary 20" text4="5:30 - 8:45"/>

4. Why can't Flash Builder find my project when I try to enable PHP support? The only one that comes out is RemoteSystemsTempFiles. Is it because there's no gateway.php? And if there is supposed to be a gateway.php, how come Flash Builder doesn't automatically create one where I've decided to create the project?
5. One way of getting MySQL data is by going to the design mode and whatnot but how could I do it directly in the mxml code?
6. How can I create a php method that will return multiple variables as different variables, instead of all of them being put in an array like the generated files?

I know this is a lot of questions, so I'd appreciate any one of these questions being answered.

DG Kim

DG Kim
01-23-2012, 09:40 AM
No answers? :confused:

01-23-2012, 04:38 PM

I was actually waiting for someone else to answer that may have more experience with this (as I've only done traditional html/php with a mySql database)

The couple times I did use wamp/mamp with FLEX, I just simply copied everthing from my release build into the place where mamp can see them (wamp/www)

and as far as bringing/binding the data back into Flex, have you thought of making xml in php before it gets brought to Flex? That's probably the best way I know of, that and bring them in as value objects through your arraycollection. IE: send your http request out, make a complete event, and then populate your arraycollection with the vo's. You might already be doing that though, and for that I apologize.

Hopefully somebody can weigh in more on this subject. Have you tried asking on stackoverflow or actionscript.org?