Trying to create a photo gallery... with little knowledge of Flex

Hey Guys,
I am trying build a photo gallery and I am having the hardest time.
Is there anything out there that helps people from scratch ?
I need help learning where to store the images... IE... jpegs
and the right syntax to call up the code...
Path info etc...
I tried to hack two of the following programs but in the case below the program could not find the files...
I am looking for an easy way to get started any help would be great
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" verticalScrollPolicy="off" horizontalScrollPolicy="off"   initialize="init()"  applicationComplete="startitup()" backgroundGradientColors="[0xffffff, 0x00808C]"  >
<mx:HTTPService id="movieRequest" url="data/otrdata.xml" result="movieHandler(event)"/>
<mx:Glow id="glowImage" duration="200"
        alphaFrom="1.0" alphaTo="0.5"
        blurXFrom="0.0" blurXTo="15.0"
        blurYFrom="0.0" blurYTo="15.0"
        color="0x00FF00"/>
    <mx:Glow id="unglowImage" duration="200"
        alphaFrom="0.3" alphaTo="1.0"
        blurXFrom="15.0" blurXTo="0.0"
        blurYFrom="15.0" blurYTo="0.0"
        color="0x0000FF"/>
<mx:Fade
    id="fade"
    target="{myImage}"
    duration="400"
    alphaFrom="0"
    alphaTo="1"/>
<mx:TextArea x="463" y="156" height="326" width="387" id="myText" fontSize="14" editable="false"/>
    <mx:Image x="23" y="157" width="432" height="325" id="myImage" scaleContent="true"   complete="fade.play()"/>
<mx:Tile direction="horizontal" borderStyle="inset"
            horizontalGap="10" verticalGap="15"
            paddingLeft="10" paddingTop="10" paddingBottom="10" paddingRight="10" x="62" y="70" width="750" height="77">
            <mx:Repeater id="rp" dataProvider="{movieData}">
                <mx:Image height="49" width="50" rollOverEffect="{glowImage}"  rollOutEffect="{unglowImage}"   mouseUpEffect="{unglowImage}" toolTip="{rp.currentItem.subtitle}" source="{rp.currentItem.icon}" click="mygothere(event.currentTarget.getRepeaterItem ())" />
            </mx:Repeater>   
            </mx:Tile>
                                    <mx:Label x="78" y="485" id="sourceTag0" width="333" textAlign="center" fontSize="14"/>
<mx:Label x="23" y="24" id="sourceTag1" fontSize="18" fontWeight="bold" width="281"/>
<mx:Image x="801" y="14" id="navimage1" source="@Embed(source='images/icons/Urbm.jpg')"  rollOverEffect="{glowImage}"  rollOutEffect="{unglowImage}"   mouseUpEffect="{unglowImage}" width="43" height="32" click="myMainget('All'),myNumfind(0)"/>
<mx:Label id="labelall" x="813" y="50" text="All" rollOverEffect="{glowImage}"  rollOutEffect="{unglowImage}"   mouseUpEffect="{unglowImage}" width="43" height="18" click="myMainget('All'),myNumfind(0)" />
<mx:Image x="383" y="14" rollOverEffect="{glowImage}"  rollOutEffect="{unglowImage}"   mouseUpEffect="{unglowImage}" source="@Embed(source='images/icons/Buddy.jpg')" width="38" height="32" id="navimage2" click="myMainget('Home'),myNumfind(0)"/>
<mx:Label x="382" y="49" text="Home" rollOverEffect="{glowImage}"  rollOutEffect="{unglowImage}" click="myMainget('Home'),myNumfind(0)"/>
<mx:Image x="435" y="14" rollOverEffect="{glowImage}"  rollOutEffect="{unglowImage}"   mouseUpEffect="{unglowImage}" source="@Embed(source='images/icons/buildingjob.jpg')" width="45" height="32" id="navimage3"  click="myMainget('City Life and Rhetoric'), myNumfind(0)"/>
<mx:Label x="430" y="49" text="Rhetoric" rollOverEffect="{glowImage}"  rollOutEffect="{unglowImage}"   mouseUpEffect="{unglowImage}"  width="56" height="19"   click="myMainget('City Life and Rhetoric'), myNumfind(0)"/>
<mx:Image x="491" y="14" rollOverEffect="{glowImage}"  rollOutEffect="{unglowImage}"   mouseUpEffect="{unglowImage}" source="@Embed(source='images/icons/slums.jpg')" width="46" height="32" id="navimage4"  click="myMainget('3 Perspectives'), myNumfind(0)" />
<mx:Label x="494" y="49" text="3 Pers" rollOverEffect="{glowImage}"  rollOutEffect="{unglowImage}"   mouseUpEffect="{unglowImage}"  width="46" height="19"   click="myMainget('3 Perspectives'), myNumfind(0)"/>
<mx:Image x="550" y="14" source="@Embed(source='images/icons/Buddy.jpg')" width="38" height="32" id="navimage5"/>
<mx:Label x="547" y="49" text="History"/>
<mx:Image x="602" y="14" source="@Embed(source='images/icons/Buddy.jpg')" width="38" height="32" id="navimage6"/>
<mx:Label x="601" y="49" text="Today"/>
<mx:Image x="650" y="14" source="@Embed(source='images/icons/Buddy.jpg')" width="38" height="32" id="navimage7"/>
<mx:Label x="648" y="50" text="Future"/>
<mx:Image x="700" y="14" source="@Embed(source='images/icons/Buddy.jpg')" width="38" height="32" id="navimage8"/>
<mx:Label x="693" y="50" text="Opinions"/>
<mx:Image x="751" y="14" source="@Embed(source='images/icons/Buddy.jpg')" width="38" height="32" id="navimage9"/>
<mx:Label x="746" y="50" text="Builders"/>
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.collections.ArrayCollection;
import flash.events.Event;
        import mx.events.DropdownEvent;
        public var mynewnum:String="Home";
         private function changeEvt(event:Event):void {
         mynewnum=event.currentTarget.selectedItem.label;
         trace(mynewnum);
               filterByCategory2();
public function startitup():void{
myImage.source ="images/Buddy.jpg";
myText.htmlText="<b>Over-the-Rhine</b> is not only at the center of the Cincinnati community, but it is also at the center of a lot of controversies. This area has become a breeding ground for social issues. Issues of equality, crime, affordible housing, poverty, violence, and economic growth have recently been argued. Although these topics are the current issues facing Over-the-Rhine, this is not the first time many of these issues have been see by Over-the-Rhine. It seems that history is repeating itself once again. So where does the community go from here? Are there any answers. The questions one must consider are simple. Will Over-the-Rhine be in the same position thirty years from now? Is the current Over-the-Rhine community being treated fairly by the city? Do the urbanist movement, the people's movement, and the CDC have the best interests of the community in mind? How can the city deal with these issues without causing a fight within the community? Can Over-the-Rhine become a community where everyone is happy?";
sourceTag1.text = "Home";
sourceTag0.text ="A Look into the Over-the-Rhine Community";
public function myNumfind(num:Number):void{
myImage.source =movieData[num].image;
myText.htmlText=movieData[num].text;
sourceTag1.text = movieData[num].title;
sourceTag0.text =movieData[num].subtitle;
public function mygothere(event:Object):void{
myImage.source =event.image;
myText.htmlText=event.text;
sourceTag1.text = event.title;
sourceTag0.text = event.subtitle;
public function myMainget(myhere:String):void{
mynewnum=myhere;
filterByCategory2();
public function filterByCategory2():void
movieData.filterFunction = catFilter2;
movieData.refresh();
public function catFilter2(item:Object):Boolean
if(mynewnum=="All"){
return true;
}else{
return item.cat == mynewnum;
[Bindable]
private var movie:String;
[Bindable]
    public var selectedItem:Object; 
[Bindable]
public var movieData:ArrayCollection;
private function init():void
movieRequest.send();
private function movieHandler(event:ResultEvent):void
movieData = event.result.otrdata.mydata;
filterByCategory2();
private function formatPositionToolTip(value:int):String{
var result:String = (value % 60).toString();
        if (result.length == 1){
            result = Math.floor(value / 60).toString() + ":0" + result;
        } else {
            result = Math.floor(value / 60).toString() + ":" + result;
        return result;
]]>
</mx:Script>
<mx:Label x="316" y="39" text="Menu" fontSize="12" fontWeight="bold" fontStyle="italic" color="#000000"/>
<mx:HRule x="364" y="49" width="480" strokeWidth="2" strokeColor="#000000"/>
</mx:Application>

I'd recommend linking your flex app to a PHP file, it'll automatically handle all the photos for you without you having to embed them all. Keeps the app size small and lets you add more pictures without having to alter any code. Here's the example code of a very simply image gallery that i'd build on if i was making a photogallery.
Flex:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="getPictures.send()">
    <mx:HTTPService id="getPictures" url="getPictures.php" method="POST" showBusyCursor="true"/>
    <mx:TileList dataProvider="{getPictures.lastResult.Pictures}" width="500" height="500" x="349" y="129">
        <mx:itemRenderer>
            <mx:Component>
                <mx:Image width="200" height="200" source="{data.imagePath}"/>
            </mx:Component>
        </mx:itemRenderer>
    </mx:TileList>
</mx:Application>
PHP:
<?php
    foreach (glob("*.png") as $filename)
        print "<Pictures><imagePath>".$filename."</imagePath></Pictures>";
?>

Similar Messages

  • Photo gallery with Thumbnail View in Flex 3

    Hello everyone
    I very urgently need an answer to a very simple qeuestoon. I have been trying really hard since days to get a solution to this simple problem but in vain.
    I am building an application in Flex 3. I simply want to create a photo gallery with a thumbnail where when the user clicks on a thumbnail, the image is shown in the canvas/tab navigator box next to it. The images are stored in a local folder (in src) are ARE NOT on available on any web link.
    The Vbox with the thumb image and the .xml file has been created. But when I click on the thumbnail, the full image cannot be seen in the application. I dont know if this is a problem with data binding or what.
    Please help!!!
    Thanks a ton.

    Check the folder structure
    Flash is not able to get some file thats why the IO Error.
    trace the url path just before u load the file and u will be abel to find whether that file is in specified folder or not.
    http://www.darshanrane.com

  • Error in creating XML photo gallery with Flash CS4 and AS 3.0

    Hello, all. I've been creating an XML photo gallery with Flash CS4 and AS 3.0 following a tutorial. I followed the instructions step-by-step but at the end I got the following error message instead:
    Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.
    Could anyone in the community assist me as to how to solve the problem? The script has no errors and last time I checked all the applicable files (the .xml file, the .jpg files, the .swf and the .fla file) are in my Documents folder on the Mac.
    Looking forward to your suggestions!

    Check the folder structure
    Flash is not able to get some file thats why the IO Error.
    trace the url path just before u load the file and u will be abel to find whether that file is in specified folder or not.
    http://www.darshanrane.com

  • Creating a photo gallery with photo download option

    Good morning,
    I need to create a page on my website where I can have a photo gallery WITH the option to download a photo, or the entire gallery. Can someone tell me, or point me to a video tutorial on how to do this?
    If you are familiar with SmugMug, or Zenfolio, they have that option where I can click to download the entire gallery or a single photo, and it downloads in the form of a zipped file.
    Can someone help me with this please?
    Thank you,
    Alex
    (I would use SmugMug or Zenfolio, but my volume does not justify the cost)

    Welcome Alex  -
    Any picture you display on your site can be saved to the visitor's computer.
    If you ZIP each gallery, a simple link to the zipped archive will offer the visitor
    an option to save to their computer.

  • Is it possible create a photo gallery with java?How do i do?

    I must create a photo gallery and I think the best code is java...but I know a little the code.Help me

    Check this list:
    http://www.java-tips.org/java-applications/photo-album-software/
    They are written in Java. They may help..

  • Can I create a photo gallery with CS4?

    I have CS4--Is it outdated, or can I still create a photo gallery to be loaded to a web site with CS4?
    Procedure?
    I have two galleries that I created with CS4 3 years ago....Is it still possible?
    Photoshop---Lightroom--Bridge?

    Yes. Use Bridge--output
    Creating a web photo gallery | Learn Adobe Bridge CS4 | Adobe TV

  • Creating flash photo gallery with Bridge

    This may not be the best way of creating a flash gallery but
    I thought I would try it since I'm new to this and it seems faster
    then editing all those photos.
    When I create the photo gallery using Adobe Bridge and then
    try to open the Flash Movie file to edit the movie it tells me
    "Cannot open a protected movie"
    Does this mean that I cannot edit the movie after Bridge
    creates it or is there a way around this?

    Welcome Alex  -
    Any picture you display on your site can be saved to the visitor's computer.
    If you ZIP each gallery, a simple link to the zipped archive will offer the visitor
    an option to save to their computer.

  • Can't create web photo gallery with modified RAW files

    I can use CS-2 to create a web photo gallery using unmodified RAW files, this seems to work fine.
    However, after I tweak the exposure of a RAW file and a .xmp file has been created, if I try to create a web photo gallery, the program goes through the motions but no thumbnails or (bigger) jpg files are created. The resulting web photo gallery pages are just filled with broken link icons.
    What's up?
    Windows 2000
    Photoshop CS-2
    Cannon RAW files (.CR2 extensions)
    Thanks,
    Mark

    I believe it may be to do with the sidecar files. My girlfriend has similar issues on Windows XP.
    I have tried to recreate the problem here (on Mac OSX) but it all works fine for me, so i can't fully test it, but here is what i believe may be happening....
    The sidecar file has the same name as the actual raw file (except the extension of course), so when the web gallery script is processing it, it does the raw file, then overwrites by trying to process the xmp file as an image, but of course it can't and then you end up with no image file in your thumbnail, or image directories in the web gallery for that image.
    Two options you can try...
    1) go into bridge and select the images to process in there (xmp files shouldn't show up there) and then use the Tools/Photoshop menu to access the WGB and choose 'Selected Bridge Images' as the source. (this has been tested successfully on win xp)
    2) in the camera raw plugin, go into preferences and change the 'sidecar xmp' option to 'camera raw database'. You will then probably need to delete any sidecar files for the folder you wish to process and reapply your raw adjustments. If the problem is what i suspect (as above) this should also work, though i haven't been able to test.
    Obviously you don't need to worry about the 'down rezzing' mentioned above as the web gallery builder should already be doing this for you...unless you changed it.

  • Creating a photo gallery with upload feature.

    I am making a photo gallery for my website. I think it would be cool to allow the upload of images to the server. I will make the gallery search for images in the folder on the server and display them, but that is not my problem. My problem is how to allow them to upload. I have been to many sites unnseccessfully. Are there any good tutorials on how to do this and how to make the server  side script. And, if possible, can i do it with out a script on the server?

    Welcome Alex  -
    Any picture you display on your site can be saved to the visitor's computer.
    If you ZIP each gallery, a simple link to the zipped archive will offer the visitor
    an option to save to their computer.

  • How create a carrosel photo gallery with Adobe Muse widgets?

    I use Adobe Muse 3.2 build 2, and I need create a photo gallery with many photos (around 60) like a carrosel (with photos and thumbnails that slides both from left to right). There is some way to create or insert a widget of this kind in Muse? If possible, in which Muse version?
    I wanted a solution that works inside of Muse, to not create a HTML page separated, with the gallery, and after embed it into the Muse.
    Thanks for any reply.

    It is currently not possible to create a functional carousel using the out-of-the-box features available in Muse. You will need to look online for third party code or a widget from a Muse widget developer for something like this.
    Cheers,
    Vikas

  • Creating a photo gallery like the China Gallery in Adobe Labs. How?

    I have photos in several categories (I'll use 2, "frank" and "wolfie" as examples here). What I'd like to do is build a photo gallery like the China Photo Gallery shown in the Adobe Labs site, where the user can switch between categories without going to a different page. Here's what I've done so far and how I'm stuck:
    I created a photo gallery with the instructions in the tutorial "Building a photo album with the Spry Framwork". I then inserted a Tabbed Panels widget for navigating between the categories.
    I set up an XML file as follows:
    /* frank category */
    <photo
    path = "001p.png"
    width = "467"
    height = "467"
    thumbpath = "001p.png"
    thumbwidth = "85"
    thumbheight = "85">
    </photo>
    /* wolfie category */
    <photo
    path = "001f.png"
    width = "467"
    height = "467"
    thumbpath = "001f.png"
    thumbwidth = "85"
    thumbheight = "85">
    </photo>
    To create the div holding the thumbnails for the "frank" category, I entered the following:
    <div class="thumbdiv" spry:region="dsGallery"><img src="thumbnails/frank/{@thumbpath}" spry:repeat="dsGallery" spry:setrow="dsGallery" class="thumbs" /></div>
    To create the div where the full size images will be displayed, I entered the following:
    <div class="mainpic" spry:detailregion="dsGallery"><img src="images/frank/{@path}" onload="MM_effectAppearFade(this, 1500, 0, 100, false)" /></div>
    Then, in the tabbed panel set for the "wolfie" category, I did the same thing, substituting "wolfie" for "frank". However, since there is only one xml file, spaceholders for all of the thumbnails appear in the thumbnail div for the frank category. I realize that I'll probably need to create a separate xml file for each category, but how do I set it up so the correct xml file is accessed when the link in the tab is clicked? Or am I approaching this all wrong?
    From reviewing the source for the China gallery, it appears that they set up links to different xml files instead of Tabbed Panels. How does that work? There are also some javascript files I can't find anywhere on Adobe's site.
    Thanks

    Hi,
    If you have seperate XML file but with the same basic structure then you can change the XML a Spry dataset refers to and regenerate the spry region without reloading the full page.
    So on my photo gallery page I can change the album the photos are shown from via the seturl sprydata function as below.  dsPhotos being my Spry dataset that points to the relevant XML dataset with my image references and captions etc.  My XML is actually dynamically generated from Picasa RSS feeds (and RSS feeds are XML) but the principle will be the same with your static XML.
    First I add an event listener for when someone clicks on an album (the li tag within my div with the id "albums" holds a photo and title for each album.)
    function Albums()
    var myalbums = Spry.$$("#albums li", "TabbedPanels1")
    var rows = dsAlbums.getData();
    var setListener = function( element, value )
      Spry.Utils.addEventListener( element, "click", function(){ showAlbum( value ); },false );
    for( var i = 0, length = myalbums.length; i < length; i++ )
      setListener( myalbums[i], i );
    Then this is the code which changes the photo album to be shown. (when the user clicks the relevant album)
    function showAlbum(i)
    pauseShow();
    pImage = 'No';
    var rows = dsAlbums.getData();
    var albumid = rows[i]["albumid"];
    var url = "xml/PicasaAphotoFeed.asp?albumid=" + albumid;
    dsPhotos.setURL(url);
    dsPhotos.loadData();
    var rowcount = dsAlbums.getRowCount() - 1;
    var nextalbum;
    var navnext;
    var n;
    The page is here www.thehmc.co.uk/photo5.html is you want to see it in context.
    In your case showAlbum would switch between Frank.xml or Wolfie.xml depending on how you decide to name your xml datasets.
    Regards
    Phil

  • Creating a Photo Gallery

    Hello there,
    I've, for a considerable amount of time now, been trying to
    create a photo gallery the same as the one on the following site:
    http://www.workingtitlefilms.com/film.php?filmID=38.
    I just don't seem to be able to make it and would be very grateful
    if somebody could help me through the entire process.
    If you don't know which part of the site I'm meaning then
    please feel free to email me and I'll send you a screen shot of the
    object I'm wanting to create; my email address is:
    [email protected]
    Thanks in advance,
    Kristopher (UK).

    You will need to create a movieClip to hold the scolling
    pictures and a clip to present the pics. The scrolling clip uses
    mouse coordinates to control the scroll and a click event to pass
    the picture info to the pic clip. There are many ways to develop
    this. I have done these in the past. You are looking at many hours
    of coding and defelopment to get it done.
    Email me if you would like to discuss this further.
    chosenson at excite dot com

  • Is it possible to create a Photo Gallery DVD with downloadable content?

    I am looking for a way to create a photo gallery, distribute it via DVD, and have the end user be able to download the photos from within the photo gallery. This would function exactly like the iPhoto web galleries, but would be distributed on DVD rather than posted to the web. Is this possible? I am looking for a way for a user to download the photos, in low res and high res, from within the DVD player.

    My first suggestion is to use Apple's Pro apps (ie, DVDSP) if you plan to use this DVD commercially. You'll get far better results and you will also be able to meet nearly all of the above objectives.
    If on the other hand you don't have the time to learn apple's pro apps which does have a large learning curve compared to the i-apps, and you are currently working with a shoestring budget, then you can meet at least some of these objectives within iDvd by adding your content to the Dvd rom section of the Dvd. The app that one uses to play the slideshow from this data section of the Dvd depends largely on the available apps on the host computer system having access to this data in terms of what software is available to play its content. Hope this makes sense but if not, just come on back. Good luck.
    Btw ... I'll check back with you later tonight since I have a fair amount of editing to do this AM.

  • Is it possible to creat a Photo Gallery on CD/DVD with downloadable content

    I am looking for a way to create a photo gallery, distribute it via CD or DVD, and have the end user be able to download the photos in the gallery from within the photo gallery. This would function exactly like the iPhoto web galleries, but would be distributed on CD/DVD rather than posted to the web. Is this possible? I am looking for a way for a user to download the photos, in low res and high res, from within a gallery browser.

    It is not a matter of my wanting to overcomplicate things. It is a client request. They want to be able to send out photos of their products on CD/DVD, have the images pop up in a nice looking preview (slideshow) and allow the user to have the ability to download the photos, low res or high res, to their desktop from within the preview (slideshow).
    This is a quite common approach for equipment manufacturers who are trying to simplify the process for their end users.

  • Photo gallery with buttons and php.

    I am relatively new to actions script, very new to as3, and brand new to php. I have tried very hard to figure all of this out via tutorials, studying the code, etc but now I'm running out of time to get this done so I need some help.
    I am trying to make a photo gallery that functions as follows:
    -the php gathers all of the filenames from a folder and returns it to flash
    -an array of buttons is loaded onto the stage (one for each photo)
    -flash then loads the first image into a movie clip.
    -when the user clicks on button[i], image[i] loads in the movie clip.
    -i also plan to incorporate what might happen if the number of photos exceeds the number of buttons that can fit nicely on the stage, like an arrow to go to another set of buttons. I haven't tried coding this yet since I was just trying to get the thing to work in general first. If anyone has ideas about this, let me know.
    Please don't make fun of me too much. I know it's probably a mess.
    Thank you so much in advance for your help.
    Here's the php:
    <!--
    Author:      Adam Ehrheart
    Site:      http://adamehrheart.com
    Blog:      http://flashcamp.net
    Date:      4.21.08
    -->
    <?php
    #   Use "." if the get_files.php file resides in the same directory as files being read
    #   Otherwise you can change the path to whatever you like
    #   eg:
    #   Same Directory:
    #   $path = ".";
    #   Other Directory
    #   $path = "products/images/"
    $path = "Photography/";
    #   Choosing what directory to read
    if ($handle = opendir($path)) {
       #   Temporary array to hold image files
       $imageFiles = array();
       #   Creating loop and assigning current file to $file temp variable
       while (false !== ($file = readdir($handle)))
          #   Checking wheter or not the file is invisible and starts with a "."
          $fileCheck = substr($file, 0, 1);
          #   Checking to make sure the files is either a (jpg, JPG, png, PNG)
          $fileType = substr($file, -3);
          #   Making sure file is not invisible
          if($fileCheck != ".")
             #   Making sure file is readable and dynamically loadable by Flash
             if($fileType == "jpg" || $fileType == "JPG" || $fileType == "png" || $fileType == "PNG")
                #   Adding File to the image array
                if($path != "."){
                array_push($imageFiles, $path . $file);
                }else{
                   array_push($imageFiles, $file);
          #   Sorting the files alphabetically
          sort($imageFiles);
       #    Creating XML File output to be read by Flash
       echo "<?xml version=\"1.0\"?>\n";
       #   Root Node
       echo "<image_list>";
       #   Creating child nodes for each image
       foreach($imageFiles as $value)
          #   Pulling the Width and Height values for each file and adding them as attributes for the image node
          list($width, $height) = getimagesize($value);
          #   Creating the image node
          echo "<image width=\"$width\"" . " height=\"$height\">" . $value . "</image>";  
       echo "</image_list>";
       #   Closing the readdir function
       closedir($handle);
    And here's the as3:
    //php photo section
    import flash.events.Event;
    import flash.net.*;
    //load the php file
    var myRequest:URLRequest = new URLRequest("Photography.php");
    var myLoader:URLLoader = new URLLoader();
    //define images variable as an xml file
    var images:XML = new XML();
    images.ignoreWhite = true;
    images.addEventListener ('load', myLoader);
    //define the images variable as an xml as the php file result
    myRequest.data = images;
    //outputting the filenames
    function onLoaded(evt:Event):void {
      trace("here we get the data back: "+myLoader.data);
    //when the data is loaded, begin myRequest
    myLoader.addEventListener(Event.COMPLETE, onLoaded);
    myLoader.load(myRequest);
    //array to call the images
    var imageArray:Array //= NewArray();
    var listLength:Number;
    var il:XMLList = images.data  //xml.images;
    listLength=il.length();
    var i:Number
    var photo_btn:Array = new Array();
    for (i = 0; i < listLength; i++); {
    imageArray[i] = il[i].pic //xml.images[i].pic;
    if (photo_btn[i].mouseDown == true) {
    img_loader.load(imageArray[i])
    if (i == 0)  {
    photo_btn[i].y = 422.7;
    photo_btn[i].x = 411.5
    else if (i > 0 && i < 24); {
    photo_btn[i].y = 422.7;
    photo_btn[i].x = (photo_btn[i-1].x + 18.6);
    if (i > 24 && i < listLength); {
    photo_btn[i].y = 442.7;
    photo_btn[i].x = (photo_btn[i-1].x + 18.6);
    img_loader.load(imageArray[0]);

    As for AS3 part of it, I am not sure your code really works. There are syntax and logical errors there.
    I think you need to take it step by step and accomplish several task in the following sequences:
    1. Write code that loads XML correctly;
    2. Write code that enables buttons;
    3. Write code that will load images on button clicks.
    The code below shows in principal what needs to be done in order to load XML and make the data in this XML available for further consumption. Also, by accomplishing this step you will iron out all the PHP vs Flash wrinkles including your XML.
    Please note, I don't know your XML structure so all the parsing issues you need to resolve yourself.
    Once you get handle on it - we, hopefully, will talk about steps 2 and 3.
    import flash.display.Loader;
    import flash.events.*;
    import flash.net.*;
    var images:XML;
    var myRequest:URLRequest;
    var myLoader:URLLoader;
    // list of image urls that will come from loaded XML
    var imageList:XMLList;
    myRequest = new URLRequest("Photography.php");
    myLoader = new URLLoader();
    myLoader.addEventListener(Event.COMPLETE, onFileLoaded);
    // suggested handler for unexpected errors - avoids some headaches
    myLoader.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
    myLoader.load(myRequest);
    // Note: all the listeners are removed
    // it is always wise to remove listeners that are needed any longer
    // to make objects eligible for arbage collection
    function onLoadError(e:IOErrorEvent):void
         trace(e.toString());
         myLoader.removeEventListener(Event.COMPLETE, onFileLoaded);
         myLoader.removeEventListener(IOErrorEvent.IO_ERROR, onLoadError);
    function onFileLoaded(e:Event):void
         myLoader.removeEventListener(Event.COMPLETE, onFileLoaded);
         myLoader.removeEventListener(IOErrorEvent.IO_ERROR, onLoadError);
         images = new XML(myLoader.data);
         // only now xml is ready and you can start loading images
         imageList= images.pic;

Maybe you are looking for

  • Auto-login then Fast User Switch out?

    I've got a few programs (e.g. Chronosync) that need to launch as a user upon login. I need these to launch at boot time. Of course, I could auto-login to this account, but that would leave the machine sitting there with an admin account logged in (so

  • Does "changing of fonts" act like a state-machine?

    hi all, in the past...i changed the font of a JComponent one at a time...i'm just wondering if changing fonts in Swing would be something like changing colours in OpenGL... for example: setColor(0, 0, 1); drawRectangle(); drawCircle(); setColor(0, 1,

  • Can I remove a running subpanel VI?

    I have seen examples of inserting VIs into a subpanel, but when inserting a new VI, the code always removes the current VI and aborts it. Is there a way to "swap out" a VI for another but keep it running in the background? "A child of five could unde

  • How to write a string into a file in java

    Say i hv a string named str.......plz give the total code of creating a file and writing the string into it

  • Iphone video sent to email...can't open...help

    I took a video with my iphone 3gs and I can't open it in my email.  What is the problem?  How can I fix this? Thanks for any help.