0 Replies Latest reply on Jun 25, 2007 6:20 AM by akiva.kent

    Must reaccess page to load external pics

    akiva.kent
      1. I must thank everyone's help in the forum for my success in loading the Total photonumber variable using LoadVars and captions from an XML file.

      2. When tested locally on different computers to ensure that paths are correct, the mini pics load correctly.

      3. However, once the files were posted to my website, you must access the page TWICE by first going to it, exiting, and when you RETURN to the same page, the mini pics are visible.

      For example, you click on the topics button which brings you to another movieclip that contains the actionscript below:
      All of the _global variables are defined in the maintime.

      These 4 mini pics are loaded from an external directory. When you click on one, the big picture shows up.

      Examples:
      http://www.4themax.com/photogallery1.html -> WFUV (photos)
      http://www.4themax.com/photogallery1.html -> Topics
      http://www.4themax.com/photogallery1.html -> Topics -> clicking the big pic will take you to a portfolio page like one of the above.

      ======================================= THE CODE ====================================
      //initialize variables and properties
      big._alpha = 0;
      //_global.WhichMainPic = 1;
      //initiate change to new image when buttons are clicked
      next.onPress = function() {
      if (_global.WhichMainPic< _global.TP[foldnum] && !fadeIn && !fadeOut) {
      fadeOut = true;
      _global.WhichMainPic++;
      input = _global.WhichMainPic;

      }
      };
      back.onPress = function() {
      if (_global.WhichMainPic>1 && !fadeIn && !fadeOut) {
      fadeOut = true;
      _global.WhichMainPic--;
      input = _global.WhichMainPic;
      }
      };
      _root.onEnterFrame = function() {
      // when a new Photo is selected, fade out, load new image, and fade in
      if (big._alpha>10 && fadeOut) {
      big._alpha -= 10;
      }
      if (big._alpha<10) {
      loadMovie(_global.PhotoFolder+"0/"+_global.WhichMainPic+".jpg", "big");
      fadeOut = false;
      fadeIn = true;
      }
      if (big._alpha<100 && fadeIn && !fadeOut) {
      big._alpha += 10;
      } else {
      fadeIn = false;
      }
      // limit input field
      if (input>_global.TP[foldnum]) {
      input =_global.TP[foldnum] ;
      }
      // initiate change to new image when Enter key is pressed
      if (Key.isDown(Key.ENTER)) {
      fadeOut = true;
      _global.WhichMainPic = input;
      }
      };
      // if a number is entered in the input field but Enter is not pressed, change
      // back to current Photo number when clicking anywhere else
      //inputField.onKillFocus = function() {
      input = _global.WhichMainPic;


      //};