Results 1 to 2 of 2

Thread: xml photo gallery

  1. #1
    Join Date
    Apr 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default xml photo gallery

    hello!!

    i m trying to create a photo gallery that load external pics using xml.

    >>> so my xml file is this:

    <gallery>
    <image title="title1 here" main="images/pic1.jpg" thmb="thumbnails/pic1thumb.jpg" />
    <image title="title2 here" main="images/pic2.jpg" thmb="thumbnails/pic2thumb.jpg" />
    </gallery>

    >>> my actionscript is this:

    myPhoto = new XML();
    myPhoto.ignoreWhite = true;
    myPhoto.onLoad = function(success) {
    //portfolioTag = this.firstChild;
    numimages = this.firstChild.childNodes.length;
    spacing = 50;
    for (i=0; i<numimages; i++) {
    this.picHolder = this.firstChild.childNodes[i];
    this.thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
    this.thumbHolder._y = i*spacing;
    this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_i mage", 0);
    this.thumbLoader.loadMovie(this.picHolder.attribut es.thmb);
    this.thumbHolder.title = this.picHolder.attributes.title;
    this.thumbHolder.main = this.picHolder.attributes.main;
    this.thumbHolder.onRelease = function() {
    loader.loadMovie(this.main);
    title_txt.text = this.title;
    };
    }
    };
    myPhoto.load("xmlphoto.xml");

    and it s working fine! BUT:
    my goal is that when u rollover the thumbnail another thumbnail loads in the same place!!! can i do that and how!?!!


    thanks for your help

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    I'm not very good with XML but in plain actionscript if you wanted that to happen the code would look something like this.

    please edit the MC names to your flash project


    Code:
    Thumbnail.onRollOver = function() {
      unloadMovie(PictureLoader)
      this.loadMovie("image2.jpg")
    }
    The XML cal command would appear where I've added image2.jpg but you should get the idea. it's just a matter of using the loadMovie and unloadMovie.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •