Jump to content


mySQL XML and Flash please help


3 replies to this topic

#1 FlawedKid

    Young Padawan

  • Members
  • Pip
  • 36 posts

Posted 15 July 2006 - 11:32 AM

Hey I need some expert assistance and direction from you guys.

I have just finished creating a Flash XML gallery and everything is working perfect, most people would consider this to be a fairly dynamic image gallery but I want to take it to another level by eliminating having to update the XML file manually.

I’ll try and explain how I think this could be updated using PHP and a mySQL database but my knowledge using both is close to nothing, so bare with me.

Ok I’ll start off with what I can do.

1 - Create a mySQL database and tables (manually).
2 - Read the tables using PHP
3 - Use PHP to create XML
4 - Read XML from within the Flash movie.

That’s it! Lol :)

I have read a lot of forums saying how easy it is to manage data using PHP, XML and mySQL but I don’t see how this is unless you are able to create tables, upload images and add data without having to open mySQL every time you want to add data and images, or am I missing something? :wacko:

At the moment my Flash gallery imports an XML file which is setup like this.
<gallery name = "IMAGE GALLERY 01">
<image title="title 1" image="/18-06-2006/image/001.jpg" thumb ="/18-06-2006/thumb/001.jpg" link ="/18-06-2006/link/001.jpg"/>
<image title="title 2" image="/18-06-2006/image/002.jpg" thumb ="/18-06-2006/thumb/002.jpg" link ="/18-06-2006/link/002.jpg"/>
</gallery>

<gallery name = "IMAGE GALLERY 02">
<image title="title 1" image="/19-06-2006/image/001.jpg" thumb ="/18-06-2006/thumb/001.jpg" link ="/19-06-2006/link/001.jpg"/>
<image title="title 2" image="/19-06-2006/image/002.jpg" thumb ="/18-06-2006/thumb/002.jpg" link ="/19-06-2006/link/002.jpg"/>
</gallery>

The gallery has two scroll panes. One is vertical which shows the galleries available, the name of each gallery is loaded from the ‘name’ attribute. The second is a horizontal pane which scrolls the thumbs, this is defined by the ‘thumb attribute. Also you will notice in the XML code there are two other attributes, ‘image’ which loads a medium size picture when the thumb is clicked and ‘link’ which opens the largest scale picture into a new window allowing the person to save the image.
This is fine for me and I have know problem simply adding new tags when its time to update the gallery but I want to make this idiot proof when I use the gallery for a clients site, and adding pictures etc is left up to them.

If someone is interested in helping me create an automated process, I am willing to offer just about anything in return for your help. The source files for the gallery, a custom web site, cash. Anything!! Except my body parts :)

#2 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 970 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 15 July 2006 - 01:27 PM

I wanna eat your toes. :)

Well, you could look into using fread and fwrite functions (and related) and have it automatically create a .xml file for you, or edit that file, whichever you're doing.
You could use a database to auto_increment the gallery number and basically store everything else.
I'm not all that familiar with XML parser scripts, so not sure if I could help you any more.

#3 FlawedKid

    Young Padawan

  • Members
  • Pip
  • 36 posts

Posted 17 July 2006 - 12:39 AM

View PostDemonslay, on Jul 16 2006, 04:27 AM, said:

I wanna eat your toes. :ph34r:

Well, you could look into using fread and fwrite functions (and related) and have it automatically create a .xml file for you, or edit that file, whichever you're doing.
You could use a database to auto_increment the gallery number and basically store everything else.
I'm not all that familiar with XML parser scripts, so not sure if I could help you any more.

Thanks for your help, but I can manage to increment the table values, create and updating the XML file and passing it to flash.
To be more pecific I need help with creating a GUI where I can create upload the three DIFFERENT size image and have the
image names increment also e.g. 001.jpg, 002.jpg and so on. I need to know if it is possible to show the data from the data base?

I will draw and example in photoshop tonight to try and explain this better.

Thanks again.

#4 funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 17 July 2006 - 09:38 AM

http://www.amfphp.org

No more need for XML files, grab the stuff directly with php from the DB and insert it in flash dynamically





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users