alright...well i'm working on a gallery...well the gallery is done and fully functional. Now i'm working on using php to put all the php information into an xml file that would be ready to parse into flash. I already have a working version of this up and running (http://www.cutshallow.com/swf/photo/photos2.html). Here is how it works....i have a php class called CustomGallery...and i made an instance of this class using the following code in a php file(CustomGallery.definition.php):
<?php
include_once("CustomGallery.class.php");
$gallery = new CustomGallery();
$gallery->setTitle("the coolest pictures you will ever see");
$gallery->setDirectory("photos/");
$gallery->addPhoto ( "142391447_l.jpg", "thumbs/142391447_l.jpg", "so flamboyant", "Mr. moves");
$gallery->addPhoto ( "142391784_l.jpg", "thumbs/142391784_l.jpg", "wild and crazy is he", "Rockin' danny");
$gallery->addPhoto ( "142392907_l.jpg", "thumbs/142392907_l.jpg", "not anymore", "Cut Shallow on tour");
$gallery->addPhoto ( "142394266_l.jpg", "thumbs/142394266_l.jpg", "the only good one of nate...and you can still barely see him", "The whole gang");
$gallery->addPhoto ( "51716042_l.jpg", "thumbs/51716042_l.jpg", "hawaiians are so hawaiian", "Hawaii");
$gallery->addPhoto ( "51801565_l.jpg", "thumbs/51801565_l.jpg", "what the...", "Wide-eyed wes");
$gallery->addPhoto ( "csmyspace.jpg", "thumbs/csmyspace.jpg", "don't we just rock your face off?", "cut shallow");
$gallery->addPhoto ( "cssicck500.jpg", "thumbs/cssicck500.jpg", "you heard me, shoot.", "Epitome of awesome");
?>
and then i used this php code in a seperate file (photoxml.php):
<?php
include_once("includes/CustomGallery.definition.php");
print "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>";
print "<photos>";
print $gallery->getThumbnailsDisplay();
print "</photos>";
?>
which displayed:
<?xml version="1.0" encoding="iso-8859-1"?>
<photos>
<photo src="photos/thumbs/142391447_l.jpg" url="photo.php?id=1/" directory="photo/"></photo>
<photo src="photos/thumbs/142391784_l.jpg" url="photo.php?id=2/" directory="photo/"></photo>
<photo src="photos/thumbs/142392907_l.jpg" url="photo.php?id=3/" directory="photo/"></photo>
<photo src="photos/thumbs/142394266_l.jpg" url="photo.php?id=4/" directory="photo/"></photo>
<photo src="photos/thumbs/51716042_l.jpg" url="photo.php?id=5/" directory="photo/"></photo>
<photo src="photos/thumbs/51801565_l.jpg" url="photo.php?id=6/" directory="photo/"></photo>
<photo src="photos/thumbs/csmyspace.jpg" url="photo.php?id=7/" directory="photo/"></photo>
<photo src="photos/thumbs/cssicck500.jpg" url="photo.php?id=8/" directory="photo/"></photo>
</photos>
and in that form i was EASILY able to parse the file into flash and do what i want with it...now the problem is...i want to be able to have multiple galleries and the only way i can think of doing this is by changing the CustomGallery.definition.php file to:
<?php
include_once("CustomGallery.class.php");
$gallery = new CustomGallery();
$otherGallery = new CustomGallery();
$galleries = array(array("name" => $gallery, "id" = 0), array("name" => $otherGallery, "id" = 1));
$gallery->setTitle("the coolest pictures you will ever see");
$gallery->setDirectory("photos/");
$gallery->addPhoto ( "142391447_l.jpg", "thumbs/142391447_l.jpg", "so flamboyant", "Mr. moves");
$gallery->addPhoto ( "142391784_l.jpg", "thumbs/142391784_l.jpg", "wild and crazy is he", "Rockin' danny");
$gallery->addPhoto ( "142392907_l.jpg", "thumbs/142392907_l.jpg", "not anymore", "Cut Shallow on tour");
$gallery->addPhoto ( "142394266_l.jpg", "thumbs/142394266_l.jpg", "the only good one of nate...and you can still barely see him", "The whole gang");
$gallery->addPhoto ( "51716042_l.jpg", "thumbs/51716042_l.jpg", "hawaiians are so hawaiian", "Hawaii");
$gallery->addPhoto ( "51801565_l.jpg", "thumbs/51801565_l.jpg", "what the...", "Wide-eyed wes");
$gallery->addPhoto ( "csmyspace.jpg", "thumbs/csmyspace.jpg", "don't we just rock your face off?", "cut shallow");
$gallery->addPhoto ( "cssicck500.jpg", "thumbs/cssicck500.jpg", "you heard me, shoot.", "Epitome of awesome");
$otherGallery ->setTitle("second gallery");
$otherGallery ->setDirectory("photos/");
$otherGallery ->addPhoto ( "142391447_l.jpg", "thumbs/142391447_l.jpg", "so flamboyant", "Mr. moves");
$otherGallery ->addPhoto ( "142391784_l.jpg", "thumbs/142391784_l.jpg", "wild and crazy is he", "Rockin' danny");
$otherGallery ->addPhoto ( "142392907_l.jpg", "thumbs/142392907_l.jpg", "not anymore", "Cut Shallow on tour");
$otherGallery ->addPhoto ( "142394266_l.jpg", "thumbs/142394266_l.jpg", "the only good one of nate...and you can still barely see him", "The whole gang");
$otherGallery ->addPhoto ( "51716042_l.jpg", "thumbs/51716042_l.jpg", "hawaiians are so hawaiian", "Hawaii");
$otherGallery ->addPhoto ( "51801565_l.jpg", "thumbs/51801565_l.jpg", "what the...", "Wide-eyed wes");
$otherGallery ->addPhoto ( "csmyspace.jpg", "thumbs/csmyspace.jpg", "don't we just rock your face off?", "cut shallow");
$otherGallery ->addPhoto ( "cssicck500.jpg", "thumbs/cssicck500.jpg", "you heard me, shoot.", "Epitome of awesome");
?>
and then change the photoxml.php file to:
<?php
include_once("includes/CustomGallery.definition.php");
print "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>";
print "<photos>";
foreach($galleries as $which) {
$id = $which["id"];
print "<gallery id=\"$id\">";
print $which["name"]->getThumbnailsDisplay();
print "</gallery>";
}
print "</photos>";
?>
to get something like this:
<?xml version="1.0" encoding="iso-8859-1" ?>
<photos>
<gallery id="0">
<photo src="photos/thumbs/142391447_l.jpg" url="photo.php?id=1/" directory="photo/" />
<photo src="photos/thumbs/142391784_l.jpg" url="photo.php?id=2/" directory="photo/" />
<photo src="photos/thumbs/142392907_l.jpg" url="photo.php?id=3/" directory="photo/" />
<photo src="photos/thumbs/142394266_l.jpg" url="photo.php?id=4/" directory="photo/" />
<photo src="photos/thumbs/51716042_l.jpg" url="photo.php?id=5/" directory="photo/" />
<photo src="photos/thumbs/51801565_l.jpg" url="photo.php?id=6/" directory="photo/" />
<photo src="photos/thumbs/csmyspace.jpg" url="photo.php?id=7/" directory="photo/" />
<photo src="photos/thumbs/cssicck500.jpg" url="photo.php?id=8/" directory="photo/" />
</gallery>
<gallery id="1">
<photo src="photos/thumbs/142391447_l.jpg" url="photo.php?id=1/" directory="photo/" />
<photo src="photos/thumbs/142391784_l.jpg" url="photo.php?id=2/" directory="photo/" />
<photo src="photos/thumbs/142392907_l.jpg" url="photo.php?id=3/" directory="photo/" />
<photo src="photos/thumbs/142394266_l.jpg" url="photo.php?id=4/" directory="photo/" />
<photo src="photos/thumbs/51716042_l.jpg" url="photo.php?id=5/" directory="photo/" />
<photo src="photos/thumbs/51801565_l.jpg" url="photo.php?id=6/" directory="photo/" />
<photo src="photos/thumbs/csmyspace.jpg" url="photo.php?id=7/" directory="photo/" />
<photo src="photos/thumbs/cssicck500.jpg" url="photo.php?id=8/" directory="photo/" />
</gallery>
</photos>
but instead all i got was this:
<?xml version="1.0" encoding="iso-8859-1" ?>
<photos>
<gallery id="0" />
<gallery id="1" />
</photos>
does anyone know what might be wrong?
and thanks sooooooooooo much for reading this! and also for helping me! cos i'm stuck and can't think of what might be wrong...