PDA

View Full Version : Dynamic Image Scroller & Content - XML vs MySql vs Both?



s.newave
January 5th, 2006, 03:29 AM
Hi,

I am getting to the last and hardest part of setting up my new flash site and need a little design advice. The last piece of functionality i want to add is a flashnav type vertical scroller which naturally displays a bunch of thumbnail images (its a real estate site so each thumbnail would represent an apt). When one of those images is clicked i would then like to load a swf into my main content area which contains a large image of the thumbnail clicked and other thumbnails and dynamic content relating to that apt such as a description as well as various other items like beds,baths,price etc. Finally my question is what do you think is the best way of going about this. Should i use an xml file which contains all the fields i would need for an apt (could be as much as 8 images, desc, and 5-6 other simple text fields per apt with 10-20 apts)? Should i store all this info in a mysql db and then use php to pull it into flash? Or perhaps a combintation of the two?

Im looking for the solution that is easiest to create and add/maintain. :}

Thanks in advance

lbeetles
January 5th, 2006, 05:40 AM
check this out http://www.kirupa.com/forum/showthread.php?t=124931 look for the gallery version, this should be exactly what you need. I have it running so that php gets the data from a MySQL db and prints it as xml which then loads into flash.

expensive_pen
January 5th, 2006, 08:23 AM
i like to MySQL to PHP to xml to flash too

s.newave
January 5th, 2006, 12:55 PM
Thanks for the quick responses and that xml menu :thumb2: . It seems you both like the mysql->php->xml->flash method. Could you explain further what advantages you gain by using this method compared with the other two? It also seems like a lot more work hehe.

expensive_pen
January 5th, 2006, 01:13 PM
it gives you flexibility,
I thinking using XML as database is dumb mostly because thats not what is designed for thus it doesnt work well and is slow, but XML is often a good and widely used as a document format expecially for interchange between systems.

avoiding XML completely is bad cause you would have to output alot of variables like


&var1=1&var2=3&var4=234&var4=1&var5=134&var6=1sd&var7=14

this gets really messy.

that is why i prefer
mysql->php->xml->flash

lbeetles
January 5th, 2006, 06:50 PM
plus also when you update you database it automatically updates the xml file each time it is run, therefore you dont have to edit the xml each time you need to add something, then there is no need to upload the updated xml file and then this is less ways of something going wrong.

s.newave
January 5th, 2006, 07:58 PM
Sounds interesting. Do you have any code samples that i could look at for the xml-php-mysql-php-xml flow.

Thanks again

lbeetles
January 6th, 2006, 04:59 AM
i will be able to post some files 2mora for you to have a look at.

s.newave
January 8th, 2006, 11:35 AM
great thx, look forward to it. Also lbeetles i noticed you were pretty active in the xml menu thread that you originally posted above. I wonder if you could help me out with something that is causing me problems with that menu. Here is the problem i posted in that thread:

"I really love this menu and was trying to integrate it into my new site however i noticed that it is set to use Flash 6 player and AS 1.0. This is causing problems with some other stuff i have just created. I know this is a nooob question but can anyone tell me how to upgrade this menu to flash 8/AS2.0 w/out losing any of the functionality? I tried changing the publish settings to Flash 8 player but that seemed to mess up the menu animation colors and then when i try to set it to AS 2.0 the compiler complains about: "There is no property with the name 'rgbToHex'.
Math.rgbToHex = function(r,g,b){"

and two others similar to the one above. Im really new to flash so im not sure how trivial or not this is but i would appreciate any help in gettin this sorted out."

thx again

tobijas20
January 10th, 2006, 03:51 AM
plus also when you update you database it automatically updates the xml file each time it is run, therefore you dont have to edit the xml each time you need to add something, then there is no need to upload the updated xml file and then this is less ways of something going wrong.
You don't have to upload XML if you have CMS that manages that online ;)
I have made CMS that changes XML with PHP.
:azn:

bootiteq
January 10th, 2006, 09:25 AM
&var1=1&var2=3&var4=234&var4=1&var5=134&var6=1sd&var7=14
this gets really messy.


Do you think it is possible to send out an xml file as a URL string then read it into flash as XML dynamically?

ericrichner
May 31st, 2007, 01:45 PM
this is exactly what i've been looking for. if we could get some examples that would be great.

im working with two php developers right now. we want to have our site completely in flash and have it utilize dynamic text fields with xml-based content. we are creating a php cms that will connect to a mysql database to store the news/portfolio entries. then we want to have the php create the xml file that will be dynamically loaded in the flash.

im not a flash/php/xml expert by any means, but i am learning and i use example code as my teacher. oh and an occasional book or two.


PS dont drink 1/2 a cup of coffee with 3 french vanilla creamers, loads of powdered creamer, and loads of sugar. you will die. just like i feel i will right now because i cant even think straight with all this sugar/caffeine.