2 Replies Latest reply on Nov 3, 2007 2:07 PM by mr.nazarko

    xml problem

    mr.nazarko Level 1
      hello,

      i have built a photo slide show where the photo is loaded into a movie clip with XML.
      the problem arises when i change the ratio of the photo --- 1:1 (600x600) to 3:4(300x400).
      im pushing the width and height to the movieclip, but it seems to hold onto the previous images ratio.

      here is a link to my working mock up
      http://www.antonnazarko.com/DAVE/test2LIST.html

      but notice if you select the photo twice ( select four from the list box - then press it again) it load with the proper dimesions.

      can any one provide any insight >?

      here is the code im using

      var x:XML = new XML();
      x.ignoreWhite = true;
      var urls:Array = new Array();
      var captions:Array = new Array();
      var w:Array = new Array();
      var h:Array = new Array();
      var whoIsOn:Number;

      x.onLoad = function(success) {
      var photos:Array = this.firstChild.childNodes;
      for (i=0; i<photos.length; i++) {
      urls.push(photos .attributes.url);
      captions.push(photos
      .attributes.caption);
      w.push(photos .attributes.width);
      h.push(photos
      .attributes.height);
      }
      trace(urls[0] + " - " + captions[0] + " - " + w[0] + " - " + h[0] );
      place.loadMovie(urls[0]);
      place._width = w[0]
      place._height = h[0]
      nav.caption.text = captions[0];
      whoIsOn = 0;
      };

      x.load(" http://www.antonnazarko.com/DAVE/photoLIST.xml");


      nav.previous.onRelease = function() {
      if (whoIsOn > 0) {
      whoIsOn--;
      trace(urls[whoIsOn] + " - " + captions[whoIsOn] + " - " + w[whoIsOn] + " - " + h[whoIsOn] );
      place._width = w[whoIsOn]
      place._height = h[whoIsOn]
      place.loadMovie(urls[whoIsOn]);
      nav.caption.text = captions[whoIsOn];
      videoList.selectedIndex = whoIsOn;
      }
      };

      nav.next.onRelease = function() {
      if (whoIsOn < urls.length-1) {
      whoIsOn++;
      trace(urls[whoIsOn] + " - " + captions[whoIsOn] + " - " + w[whoIsOn] + " - " + h[whoIsOn] );
      place._width = w[whoIsOn]
      place._height = h[whoIsOn]
      place.loadMovie(urls[whoIsOn]);
      nav.caption.text = captions[whoIsOn];
      videoList.selectedIndex = whoIsOn;
      }
      };