Problems with creating an interactive photogallery for my school

Hi all,

For the last couple of weeks, i’ve been trying to develope an interactive yearbook for my school. Im using an external XML, and trying to push all the data in the xml to assigned arrays.

Also im trying to use a for loop to create empty movie clips. This empty clips will serve as “pages” if the total number of students is greater than 25. Also, on these pages im trying to attachMovie to a specific x, and Y, as you’ll see in my source code.

Other than that, i can not figure out where im going wrong.

When i first try to publish it, it gives me an error saying that the path is undefined, and will not load ANYTHING. if i make a few changes, it just sits there blanky.

If you need the fla file please let me know, and thanks in advance for reading this post, and helping out.


stop();
import mx.utils.Delegate;
import mx.transitions.Tween;
import mx.transitions.easing.*;
var students:Number;
var row:Number;
var col:Number;
var student:Number;
var slots:Number = 25;
var pages:Boolean;
var numOfPages:Number;
var tabRCN:Number = 5;
//Create the Arrays
studName = new Array();
studField = new Array();
studDog = new Array(); 
studClubs = new Array();
studQuote = new Array();
studMsg = new Array();
studImg = new Array();
page = new Array();
var tooltip:MovieClip = stu.attachMovie("tooltip","tooltip",10000);
tooltip._alpha = 0;
_root.info_mc._visible = false;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function(success){
 if(success){
  nodes = xml.firstChild.childNodes;
  students = xml.firstChild.childNodes.length;
 
  //load the students
  for(student = 0; student < students; student++){
   studName[student] = nodes[student].attributes.name;
   studField[student] = nodes[student].attributes.field;
   studDog[student] = nodes[student].attributes.dog;
   studClubs[student] = nodes[student].attributes.clubs;
   studQuote[student] = nodes[student].attributes.quote;
   studMsg[student] = nodes[student].attributes.msg;
   studImg[student] = nodes[student].attributes.image;
  }
 
  //caculate pages
  if (students > slots){
   pages = true;
   if(pages == true){
    remain = students % slots;
    btns.visible = true;
    btns.btn_next.onRelease = nxtPg;
    if(remain >= 1){
     numOfPages = ((students - remain) / slots) + 1;
    } else {
     numOfPages = students / slots;
    } // End page number caculation
    for(paged = 0; paged < numOfPages; paged++){
     page[paged] = _root.createEmptyMovieClip("paged"+page,getNextHighestDepth());
     page[paged].visble = false;
     page[paged].onEnterFrame = placed;
     for(place = 0; place < slots; place++){
      var stu = page[paged].attachMovie("item","item"+student,student + 1);
      stu.onEnterFrame = placement;
      stu.toolText = studName[student];
      stu.icon.inner.loadMovie(studImg[student]);
      stu.r.inner.loadMovie(studImg[student]);
      stu.onEnterFrame = placement;
      stu.onMouseOver = over;
      stu.onRelease = released;
     }
    }
   } else { // pages = false
    btns.visible = false;
    for(row = 0; row < tabRCN; row++){
     for(col = 0; col < tabRCN; col++){
      var stu = page[0].attachMovie("item","item"+student,student + 1);
      stu.onEnterFrame = placement;
      stu.toolText = studName[student];
      stu.icon.inner.loadMovie(studImg[student]);
      stu.r.inner.loadMovie(studImg[student]);
      stu.onEnterFrame = placement;
      stu.onMouseOver = over;
      stu.onRelease = released;
     }
    }
    _root.page[0].visible = true;
   } // end else statement
  }// end load statement
 } else {
  alert("Students Could Not be loaded..Disk Malifunction");
 }
}
xml.load("web/roster.xml");
function released(){
 _root.page[paged]._alpha = 100;
 _root.info_mc._alpha = 0;
 _root.info_mc.name = studName[student];
 _root.info_mc.field = studField[student];
 _root.info_mc.dog = studDog[student];
 _root.info_mc.clubs = studClubs[student];
 _root.info_mc.quote = studQuote[student];
 _root.info_mc.msg = studMsg[student];
 _root.info_mc.bigImg = studImg[student];
}
function over(){
 tooltip.visible = true;
 tooltip.text = stu.toolText;
}
function nextPg(){
 curPage = _root.page[paged];
 nextPage = _root.page[paged + 1];
 curPage.visible = false;
 nextPage.visible = true;
 if(curPage == page[0]){
  _root.btns.btn_back._alpha = 25;
 } else {
  _root.btns.btn_back._alpha = 100;
 }
}
function backPg(){
 curPage = _root.page[paged];
 nextPage = _root.page[paged - 1];
 curPage.visible = false;
 nextPage.visible = true;
 if(curPage == page[paged = numOfPages]){
  _root.btns.btn_next._alpha = 25;
 } else {
  _root.btns.btn_next._alpha = 100;
 }
}
function placed(){
 this._width = 640;
 this._height = 656.75 ;
 this._x = 80;
 this._y = 0;
}
function placement(){
 for(row = 0; row < tabRCN; row++){
  for(col = 0; col < tabRCN; col++){
   w = this._width;
   h = this._height;
   xPos = (col * w) + w;
   yPos = (row * h) + h;
   this._x = xPos;
   this._y = yPos;
  }
 }
}