Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Aug 2005
    Posts
    87
    Member #
    10945
    Hi, I have designed a Flash Actionscript photogallery that also uses XML and for some reason it displays some of the jpegs normally. But as for the rest of them, the jpegs are screwed up. A part of the image is faded, or another image doesn't show up at all. And yet another one is distorted and it didn't look that way in Photoshop!

    I think my problem has to do with the jpegs itself but just in case I have provided the code for my photo gallery. The url is: http://www.jonesumc.org/photogallery.html

    This is how I arranged the jpegs in the XML file:
    Code:
    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <images>
    <pic>
    <image>jones60th.jpg</image>
    <caption>Jones Anniversary Photo</caption>
    </pic> 
    
    <pic>
    <image>gospelsinger.jpg</image>
    <caption>Name Of Photo</caption>
    </pic>
    
    <pic>
    <image>members3.jpg</image>
    <caption>Name Of Photo</caption>
    </pic>
    
    <pic>
    <image>musician2.jpg</image>
    <caption>Name Of Photo</caption>
    </pic>
    
    <pic>
    <image>minister4.jpg</image>
    <caption>Name Of Photo</caption>
    </pic>
    
    <pic>
    <image>service2.jpg</image>
    <caption>Name Of Photo</caption>
    </pic>
    
    <pic>
    <image>members4.jpg</image>
    <caption>Name Of Photo</caption>
    </pic>
    
    <pic>
    <image>minister2.jpg</image>
    <caption>Name Of Photo</caption>
    </pic>
    
    <pic>
    <image>members6.jpg</image>
    <caption>Name Of Photo</caption>
    </pic>
    
    <pic>
    <image>service3.jpg</image>
    <caption>Name Of Photo</caption>
    </pic>
    
    <pic>
    <image>members5.jpg</image>
    <caption>Name Of Photo</caption>
    </pic>
    
    <pic>
    <image>service4.jpg</image>
    <caption>Name Of Photo</caption>
    </pic>
    
    <pic>
    <image>members8.jpg</image>
    <caption>Name Of Photo</caption>
    </pic>
    
    <pic>
    <image>members7.jpg</image>
    <caption>Name Of Photo</caption>
    </pic>
    </images>
    And this is how I created the actionscript in Flash for the photo gallery:
    Code:
    function loadXML(loaded) { 
    if (loaded) { 
    xmlNode = this.firstChild; 
    image = []; 
    description = []; 
    total = xmlNode.childNodes.length; 
    for (i=0; i<total; i++) { 
    image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue; 
    description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue; 
    } 
    firstImage(); 
    } else { 
    content = "file not loaded!"; 
    } 
    } 
    xmlData = new XML(); 
    xmlData.ignoreWhite = true; 
    xmlData.onLoad = loadXML; 
    xmlData.load("images.xml"); 
    ///////////////////////////////////// 
    listen = new Object(); 
    listen.onKeyDown = function() { 
    if (Key.getCode() == Key.LEFT) { 
    prevImage(); 
    } else if (Key.getCode() == Key.RIGHT) { 
    nextImage(); 
    } 
    }; 
    Key.addListener(listen); 
    previous_btn.onRelease = function() { 
    prevImage(); 
    }; 
    next_btn.onRelease = function() { 
    nextImage(); 
    }; 
    ///////////////////////////////////// 
    p = 0; 
    this.onEnterFrame = function() { 
    filesize = picture.getBytesTotal(); 
    loaded = picture.getBytesLoaded(); 
    preloader._visible = true; 
    if (loaded != filesize) { 
    preloader.preload_bar._xscale = 100*loaded/filesize; 
    } else { 
    preloader._visible = false; 
    if (picture._alpha<100) { 
    picture._alpha += 10; 
    } 
    } 
    }; 
    function nextImage() { 
    if (p<(total-1)) { 
    p++; 
    if (loaded == filesize) { 
    picture._alpha = 0; 
    picture.loadMovie(image[p], 1); 
    desc_txt.text = description[p]; 
    picture_num(); 
    } 
    } 
    } 
    function prevImage() { 
    if (p>0) { 
    p--; 
    picture._alpha = 0; 
    picture.loadMovie(image[p], 1); 
    desc_txt.text = description[p]; 
    picture_num(); 
    } 
    } 
    function firstImage() { 
    if (loaded == filesize) { 
    picture._alpha = 0; 
    picture.loadMovie(image[0], 1); 
    desc_txt.text = description[0]; 
    picture_num(); 
    } 
    } 
    function picture_num() { 
    current_pos = p+1; 
    pos_txt.text = current_pos+" / "+total; 
    }

  2.  

  3. #2
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,657
    Member #
    1234
    Liked
    138 times
    just cycled through both gallerys, no problems at all. Clear your cache, it may be corrupted.
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:55 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com