home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FCE Gold Plus
/
GOLD.iso
/
pc
/
main.swf
/
scripts
/
__Packages
/
UnitData.as
< prev
Wrap
Text File
|
2007-11-02
|
30KB
|
818 lines
class UnitData extends Friends_navigation
{
var unit = new Array();
var textFieldArr = new Array();
var movieClips = ["","btn_secondpage","btn_activitypage"];
function UnitData(nonGAB, theGAB)
{
super();
this.unit = [];
this.currentPage = 0;
this.theNonGABmc = nonGAB;
this.theGABmc = theGAB;
this.firstPage = _root.firstPage;
this.unitInfo = _root.unitInfo;
this.secondPage = _root.secondPage;
this.activityPage = _root.activityPage;
this.baseNav = _root.baseNav;
this.topNav = _root.topNav;
this.firstPage._visible = false;
this.secondPage._visible = false;
this.theGABmc._visible = false;
this.theNonGABmc._visible = false;
this.baseNav._visible = false;
this.activityPage.theTitle.embedFonts = true;
this.activityPage.theRubric.embedFonts = true;
this.activityPage.theRubric.autoSize = true;
this.activityPage.unitTitleTxtObj1.embedFonts = true;
this.activityPage.unitTitleTxtObj2.embedFonts = true;
this.activityPage._visible = false;
this.secondPageStartX = this.secondPage.dummy._x;
this.secondPageStartY = this.secondPage.dummy._y;
this.secondPage.dummy.swapDepths(0);
this.secondPage.dummy.removeMovieClip();
this.secondPage.spSecondPage.setStyle("borderStyle","none");
this.secondPage.spSecondPage.setStyle("backgroundColor",_root.bgColour);
this.initTopNavBtns();
this.disablePrintBtn();
}
function getNavArr(arr)
{
this.arrData = arr;
this.fillFirstPage();
}
function clearActivities()
{
var _loc4_ = this.theNonGABmc._name;
var _loc3_ = this.theNonGABmc._parent;
this.clearMovies("textFieldArr");
this.activityPage.theTitle.text = "";
this.activityPage.theRubric.text = "";
this.theNonGABmc.swapDepths(0);
this.theNonGABmc.removeMovieClip();
this.theNonGABmc = _loc3_.createEmptyMovieClip(_loc4_,_loc3_.getNextHighestDepth());
this.theGABmc.unloadActivity();
this.theNonGABmc._visible = false;
_root.activityPage._visible = false;
_root.baseNav._visible = false;
this.theGABmc._visible = false;
}
function activityOnLoad(nodeData)
{
this.fileData = nodeData;
if(!nodeData.dictionary)
{
this.clearActivities();
}
if(!nodeData.arrActivities)
{
this.firstPage._visible = false;
this.secondPage._visible = false;
this.currentPage = 3;
_root.loadActivities(nodeData);
}
else
{
this.firstPage._visible = false;
this.secondPage._visible = true;
this.activityPage._visible = false;
this.currentPage = 2;
_root.loadActivities(nodeData);
}
}
function activityLoadComplete(fileData)
{
if(fileData.header)
{
if(fileData.header.split(" - ")[1] != undefined)
{
this.activityPage.theTitle.htmlText = "<font color=\"#" + _root.headerTypeColour + "\">" + fileData.label + "</font> " + fileData.header.split(" - ")[1];
}
else if(fileData.header.split(" ΓÇô ")[1] != undefined)
{
this.activityPage.theTitle.htmlText = "<font color=\"#" + _root.headerTypeColour + "\">" + fileData.label + "</font> " + fileData.header.split(" ΓÇô ")[1];
}
else
{
this.activityPage.theTitle.htmlText = "<font color=\"#" + _root.headerTypeColour + "\">" + fileData.label + "</font> " + fileData.header;
}
if(fileData.rubric)
{
this.activityPage.theRubric.htmlText = fileData.rubric;
}
}
if(this.currentPage == 3)
{
if(!(fileData.link.url == "activities.swf" || fileData == undefined))
{
this.initBaseNav(fileData);
this.initTopNavBtns();
}
}
if(fileData.link.url == "grammar.swf" || fileData.link.url == "grammarActivities.swf")
{
this.disablePrintBtn();
}
else if(fileData.link.url == "preview.swf")
{
this.theGABContent.theTitleScrollPane._visible = false;
trace(this.theGABContent.theTitleScrollPane.spContentHolder.theTextField.htmlText.split(" - ")[1]);
var _loc4_ = new Color(this.theGABContent.theHeaderSeparator);
_loc4_.setRGB(_root.lineColour);
if(this.theGABContent.theTitleScrollPane.spContentHolder.theTextField.htmlText.split(" - ")[1] != undefined)
{
this.activityPage.theTitle.htmlText = "<font color=\"#" + _root.headerTypeColour + "\">" + fileData.label + "</font>: " + this.theGABContent.theTitleScrollPane.spContentHolder.theTextField.htmlText.split(" - ")[1];
}
else if(this.theGABContent.theTitleScrollPane.spContentHolder.theTextField.htmlText.split(" ΓÇô ")[1] != undefined)
{
this.activityPage.theTitle.htmlText = "<font color=\"#" + _root.headerTypeColour + "\">" + fileData.label + "</font>: " + this.theGABContent.theTitleScrollPane.spContentHolder.theTextField.htmlText.split(" ΓÇô ")[1];
}
else
{
this.activityPage.theTitle.htmlText = "<font color=\"#" + _root.headerTypeColour + "\">" + fileData.label + "</font>";
}
if(this.theGABContent.theRubricScrollPane.spContentHolder.theTextField.text != "")
{
this.activityPage.theRubric.htmlText = this.theGABContent.theRubricScrollPane.spContentHolder.theTextField.htmlText;
}
if(fileData.label == "Language Quiz")
{
this.activityPage.unitTitleTxtObj1.text = "Quiz";
}
this.theGABmc._visible = true;
}
if(this.currentPage == 3)
{
this.activityPage._visible = true;
}
}
function getUnitNumber(str)
{
return "Module " + Number(str.substring(3,5));
}
function initRollOvers(btn)
{
btn.onRollOver = function()
{
this.gotoAndStop(2);
};
btn.onRollOut = function()
{
this.gotoAndStop(1);
};
btn.onReleaseOutside = function()
{
this.gotoAndStop(1);
};
}
function theCheckButtonPress()
{
this.theGABContent.theCheckButton.onPress();
}
function theShowButtonPress()
{
this.theGABContent.theShowButton.onPress();
this.theNonGABmc.showBtn.onRelease();
}
function theRestartButtonPress()
{
this.theGABContent.theRestartButton.onPress();
this.theNonGABmc.resetBtn.onRelease();
}
function thePlayAllButtonPress()
{
this.theGABContent.thePlayAllButton.onRelease();
}
function onScores(correct, total)
{
this.baseNav.theScore._visible = true;
this.baseNav.theScore.score = correct + "/" + total;
var _loc3_ = {};
_loc3_.baseNav = this.baseNav;
_loc3_.theGABContent = this.theGABContent;
_loc3_.onMouseDown = function()
{
if(!this.theGABContent.theScrollPane.vSB.hitTest(_root._xmouse,_root._ymouse))
{
this.baseNav.theScore._visible = false;
Mouse.removeListener(this);
}
};
Mouse.addListener(_loc3_);
}
function initBaseNav(nodeData)
{
var manager = this;
this.baseNav.nodeData = nodeData;
this.baseNav._visible = true;
this.baseNav.theScore._visible = false;
this.theGABContent = this.theGABmc.activityManager_mc.assetsHolder_mc.content_mc.depthChild0;
this.initRollOvers(this.baseNav.thePlayAllButton);
this.initRollOvers(this.baseNav.theCheckButton);
this.initRollOvers(this.baseNav.theShowButton);
this.initRollOvers(this.baseNav.theRestartButton);
this.baseNav.theCheckButton._visible = false;
this.baseNav.theShowButton._visible = false;
this.baseNav.theRestartButton._visible = false;
this.baseNav.thePlayAllButton._visible = false;
this.baseNav.theCheckButton.theGABContent = this.theGABContent;
this.baseNav.theShowButton.theGABContent = this.theGABContent;
this.baseNav.theRestartButton.theGABContent = this.theGABContent;
this.baseNav.thePlayAllButton.theGABContent = this.theGABContent;
this.baseNav.theCheckButton.theNonGABmc = this.theNonGABmc;
this.baseNav.theShowButton.theNonGABmc = this.theNonGABmc;
this.baseNav.theRestartButton.theNonGABmc = this.theNonGABmc;
this.baseNav.thePlayAllButton.theNonGABmc = this.theNonGABmc;
if(nodeData.link.url == "preview.swf")
{
this.theGABContent.theScore._visible = false;
if(this.theGABContent.thePlayAllButton._visible)
{
this.theGABContent.thePlayAllButton._visible = false;
this.baseNav.thePlayAllButton._visible = true;
this.baseNav.thePlayAllButton.onRelease = manager.thePlayAllButtonPress;
}
if(this.theGABContent.theCheckButton._visible)
{
this.theGABContent.theCheckButton._visible = false;
this.baseNav.theCheckButton._visible = true;
this.baseNav.theCheckButton.onPress = manager.theCheckButtonPress;
}
if(this.theGABContent.theShowButton._visible)
{
this.theGABContent.theShowButton._visible = false;
this.baseNav.theShowButton._visible = true;
this.baseNav.theShowButton.onPress = manager.theShowButtonPress;
}
if(this.theGABContent.theRestartButton._visible)
{
this.theGABContent.theRestartButton._visible = false;
this.baseNav.theRestartButton._visible = true;
this.baseNav.theRestartButton.onPress = manager.theRestartButtonPress;
}
}
else if(nodeData.link.url == "wordsearch.swf")
{
this.theNonGABmc.showBtn._visible = false;
this.baseNav.theShowButton.onPress = manager.theShowButtonPress;
this.theNonGABmc.resetBtn._visible = false;
this.baseNav.theRestartButton.onPress = manager.theRestartButtonPress;
}
this.initRollOvers(this.baseNav.next);
this.initRollOvers(this.baseNav.back);
this.initRollOvers(this.baseNav.home);
this.baseNav.next._visible = false;
this.baseNav.back._visible = false;
this.baseNav.home._visible = false;
if(nodeData.nodePath[0] == 0)
{
this.baseNav.home._visible = true;
}
this.baseNav.home.unitText.embedFonts = true;
this.baseNav.home.unit = nodeData.nodePath[1];
this.baseNav.home.unitText.text = "Module " + (nodeData.nodePath[1] + 1);
this.baseNav.home.onRelease = function()
{
_root.navigation.unitBtnClicked(this.unit,true);
};
var manager = this;
if(!nodeData.isActivity)
{
this.nodeDataNext = _root.navigation.getUnitInfo(nodeData.nodePath.slice(),1);
this.nodeDataCurr = _root.navigation.getUnitInfo(nodeData.nodePath.slice(),0);
this.nodeDataPrev = _root.navigation.getUnitInfo(nodeData.nodePath.slice(),-1);
if(nodeData.refNo == 0)
{
this.baseNav.back.unit = nodeData.nodePath[1];
if(nodeData.nodePath[0] == 0)
{
this.baseNav.back._visible = true;
this.baseNav.back.onRelease = function()
{
_root.navigation.unitBtnClicked(this.unit,true);
};
}
}
else
{
this.baseNav.back._visible = true;
this.baseNav.back.onRelease = function()
{
var _loc2_ = {};
_loc2_.nodeData = manager.nodeDataPrev;
_root.navigation.onFileClicked(_loc2_,false);
};
}
if(this.nodeDataNext != undefined)
{
this.baseNav.next._visible = true;
this.baseNav.next.onRelease = function()
{
var _loc2_ = {};
_loc2_.nodeData = manager.nodeDataNext;
_root.navigation.onFileClicked(_loc2_,false);
};
}
}
else
{
this.nodeDataNext = _root.navigation.getUnitInfo(nodeData.nodePath.slice(),1);
this.nodeDataCurr = _root.navigation.getUnitInfo(nodeData.nodePath.slice(),0);
this.nodeDataPrev = _root.navigation.getUnitInfo(nodeData.nodePath.slice(),-1);
if(nodeData.refNo == 0)
{
if(nodeData.nodePath[0] == 0)
{
this.baseNav.back._visible = true;
this.baseNav.back.onRelease = function()
{
var _loc2_ = {};
_loc2_.nodeData = manager.nodeDataCurr;
_root.navigation.unitBtnClicked(_loc2_.nodeData.nodePath[1] + 1);
};
}
}
else
{
this.baseNav.back._visible = true;
this.baseNav.back.onRelease = function()
{
var _loc2_ = {};
_loc2_.nodeData = manager.nodeDataPrev;
_root.onFileClicked(_loc2_.nodeData);
};
}
if(this.nodeDataNext != undefined)
{
this.baseNav.next._visible = true;
this.baseNav.next.onRelease = function()
{
var _loc2_ = {};
_loc2_.nodeData = manager.nodeDataNext;
_root.onFileClicked(_loc2_.nodeData);
};
}
}
}
function disablePrintBtn()
{
this.topNav.printBtn.useHandCursor = false;
this.topNav.printBtn.onRelease = undefined;
this.topNav.printBtn.onRollOver = undefined;
this.topNav.printBtn.onRollOut = undefined;
this.topNav.printBtn.onReleaseOutside = undefined;
}
function initTopNavBtns()
{
var manager = this;
_root.btnHomeAni.home.useHandCursor = false;
this.topNav.quitBtn.onRelease = function()
{
manager.activityOnLoad(undefined);
_root.navigation.disable();
manager.topNav.quitBtn.onRelease = false;
manager.topNav.dictionary._visible = false;
manager.topNav.printBtn.onRelease = false;
_root.gotoAndStop(2);
};
this.initRollOvers(this.topNav.quitBtn);
this.initRollOvers(this.topNav.dictionary);
this.topNav.dictionary.onRelease = function()
{
if(!(manager.currentPage == 3 && _root.extension._currentframe != 10))
{
_root.activity_holder.activityGram.swapDepths(0);
_root.activity_holder.activityGram.removeMovieClip();
manager.activityOnLoad({dictionary:true});
if(_root.currentHolder)
{
trace("Current holder: " + _root.currentHolder);
manager.baseNav._visible = true;
manager.baseNav.reference1._visible = false;
manager.baseNav.reference2._visible = false;
manager.baseNav.reference3._visible = false;
manager.baseNav.next._visible = false;
manager.baseNav.back.onRelease = function()
{
_root.currentHolder._visible = true;
if(_root.headerActive)
{
_root.activityHeader._visible = true;
}
_root.activity_holder.dictionary.swapDepths(0);
_root.activity_holder.dictionary.removeMovieClip();
manager.initBaseNav(manager.baseNav.nodeData);
};
}
}
};
this.initRollOvers(this.topNav.printBtn);
this.topNav.printBtn.theGABContent = this.theGABContent;
this.topNav.printBtn.useHandCursor = true;
this.topNav.printBtn.onRelease = function()
{
var _loc6_ = undefined;
_root.printCov._visible = true;
var _loc10_ = undefined;
var _loc9_ = undefined;
var _loc3_ = new Array();
if(_root.printObj.gab)
{
_loc6_ = _root.printObj.path.activityManager_mc;
var _loc4_ = this.theGABContent.theScrollPane.height;
var _loc5_ = this.theGABContent.theScrollPane._height + 5;
var _loc8_ = 975 - this.theGABContent.theScrollPane._y;
this.theGABContent.theTitleScrollPane._visible = true;
this.theGABContent.theRubricScrollPane._visible = true;
if(_loc5_ > _loc4_ + 1)
{
_loc9_ = this.theGABContent.theScrollPane.vPosition;
this.theGABContent.theScrollPane.vPosition = 0;
this.theGABContent.theScrollPane._yscale = _loc5_ / _loc4_ * 100;
this.theGABContent.theScrollPane.spContentHolder._yscale = _loc4_ / _loc5_ * 100;
if(_loc8_ / _loc5_ < 1)
{
this.theGABContent.theScrollPane.spContentHolder._yscale *= _loc8_ / _loc5_;
this.theGABContent.theScrollPane.spContentHolder._xscale *= _loc8_ / _loc5_;
_loc10_ = _loc8_ - _loc4_;
}
else
{
_loc10_ = 100 * _loc4_ / this.theGABContent.theScrollPane.spContentHolder._yscale - _loc4_;
}
this.theGABContent.theScrollPane.vScrollPolicy = "off";
}
_loc3_ = [this.theGABContent.theCheckButton._visible,this.theGABContent.theShowButton._visible,this.theGABContent.theRestartButton._visible,this.theGABContent.thePlayAllButton._visible,this.theGABContent.theScore._visible];
if(_loc3_[0])
{
this.theGABContent.theCheckButton._visible = false;
}
if(_loc3_[1])
{
this.theGABContent.theShowButton._visible = false;
}
if(_loc3_[2])
{
this.theGABContent.theRestartButton._visible = false;
}
if(_loc3_[3])
{
this.theGABContent.thePlayAllButton._visible = false;
}
if(_loc3_[4])
{
this.theGABContent.theScore._visible = false;
}
}
else
{
_loc6_ = _root.printObj.path;
}
_loc6_._xscale = _root.printObj.scale;
_loc6_._yscale = _root.printObj.scale;
var _loc7_ = new PrintJob();
if(_loc7_.start())
{
_loc7_.addPage(_loc6_,{xMin:0,xMax:800,yMin:0,yMax:1200},null,1);
_loc7_.send();
}
false;
if(_root.printObj.gab)
{
if(_loc3_[0] != undefined)
{
this.theGABContent.theCheckButton._visible = _loc3_[0];
}
if(_loc3_[1] != undefined)
{
this.theGABContent.theShowButton._visible = _loc3_[1];
}
if(_loc3_[2] != undefined)
{
this.theGABContent.theRestartButton._visible = _loc3_[2];
}
if(_loc3_[3] != undefined)
{
this.theGABContent.thePlayAllButton._visible = _loc3_[3];
}
if(_loc3_[4] != undefined)
{
this.theGABContent.theScore._visible = _loc3_[4];
}
if(_loc5_ > _loc4_ + 1)
{
this.theGABContent.theScrollPane._yscale = 100;
this.theGABContent.theScrollPane.spContentHolder._yscale = 100;
this.theGABContent.theScrollPane.spContentHolder._xscale = 100;
this.theGABContent.theScrollPane.vPosition = _loc9_;
this.theGABContent.theScrollPane.vScrollPolicy = "auto";
}
this.theGABContent.theTitleScrollPane._visible = false;
this.theGABContent.theRubricScrollPane._visible = false;
}
_loc6_._xscale = 100;
_loc6_._yscale = 100;
_root.printCov._visible = false;
};
}
function fillInformation(id, firstcall)
{
this.firstPage._visible = true;
this.firstPage.gotoAndPlay(2);
}
function searchArr(arr, val)
{
var _loc2_ = arr.length;
var _loc1_ = 0;
while(_loc1_ < _loc2_)
{
if(arr[_loc1_] == val)
{
return true;
}
_loc1_ = _loc1_ + 1;
}
return false;
}
function attachMC(linkage, x, y, mcData, id)
{
var _loc3_ = this.secondPage.spSecondPage.content.attachMovie(this.movieClips[linkage],"mc_" + this.count,this.count + 1);
this.activeMovieClips[this.count] = _loc3_;
var _loc7_ = this;
if(linkage == 0)
{
_loc3_.header.embedFonts = true;
_loc3_.header.htmlText = mcData;
}
else if(linkage == 1)
{
_loc3_.nodeData = mcData;
_loc3_.rollo._visible = false;
_loc3_.rolloFrame = 2;
_loc3_.label = mcData.label;
if(mcData.name)
{
_loc3_.actName = mcData.name;
}
_loc3_.txtLabel.embedFonts = true;
_loc3_.txtName.embedFonts = true;
_loc3_.txtLabel.html = true;
_loc3_.txtName.html = true;
_loc3_.onRollOver = function()
{
this.gotoAndStop(this.rolloFrame);
this.txtLabel.embedFonts = true;
this.txtName.embedFonts = true;
};
_loc3_.onRelease = function()
{
this.rollo._visible = false;
var _loc3_ = {};
_loc3_.nodeData = this.nodeData;
_root.navigation.onFileClicked(_loc3_,false);
};
_loc3_.onRollOut = function()
{
this.gotoAndStop(1);
this.txtLabel.embedFonts = true;
this.txtName.embedFonts = true;
};
_loc3_.onReleaseOutside = function()
{
this.gotoAndStop(1);
this.txtLabel.embedFonts = true;
this.txtName.embedFonts = true;
};
_loc3_.useHandCursor = false;
}
else if(linkage == 2)
{
_loc3_.nodeData = mcData;
_loc3_.rollo._visible = false;
_loc3_.rolloFrame = 2;
_loc3_.actName = mcData.fullName;
_loc3_.txtName.embedFonts = true;
_loc3_.txtName.html = true;
_loc3_.onRollOver = function()
{
this.gotoAndStop(this.rolloFrame);
this.txtName.embedFonts = true;
};
_loc3_.onRelease = function()
{
this.rollo._visible = false;
var _loc3_ = {};
_loc3_.nodeData = this.nodeData;
_root.navigation.onFileClicked(_loc3_,false);
};
_loc3_.onRollOut = function()
{
this.gotoAndStop(1);
this.txtName.embedFonts = true;
};
_loc3_.onReleaseOutside = function()
{
this.gotoAndStop(1);
this.txtName.embedFonts = true;
};
_loc3_.useHandCursor = false;
}
this.count = this.count + 1;
_loc3_._x = x;
_loc3_._y = y;
}
function makeUnitDisplay(id)
{
if(this.currentPage != 2)
{
}
}
function createUnitNav(id)
{
var _loc3_ = this.arrData[id].arrSubSections;
var _loc5_ = this.arrData[id].label;
var _loc7_ = this;
var _loc4_ = 32;
this.currentUnit = id;
this.secondPage._visible = true;
this.secondPage.unitTitleTxtObj1.embedFonts = true;
this.secondPage.unitTitleTxtObj2.embedFonts = true;
this.secondPage.theUnitTitle = _loc5_;
this.activityPage.theUnitTitle = _loc5_;
this.clearMovies("activeMovieClips");
this.count = 0;
var _loc2_ = 0;
while(_loc2_ < _loc3_.length)
{
this.attachMC(1,0,_loc2_ * _loc4_ + 30,_loc3_[_loc2_]);
_loc2_ = _loc2_ + 1;
}
this.secondPage.spSecondPage.setStyle("borderStyle","none");
this.currentPage = 2;
}
function createActivityNav(activityData, nodePath)
{
var _loc4_ = activityData.arrSubSections;
var _loc3_ = 0;
while(_loc3_ < _loc4_.length)
{
var _loc5_ = new Array();
_loc5_ = nodePath.slice();
_loc5_.push(_loc4_[_loc3_].refNo);
_loc4_[_loc3_].nodePath = _loc5_;
_loc3_ = _loc3_ + 1;
}
var _loc8_ = activityData.label;
var _loc10_ = this;
var _loc6_ = 32;
if(this.currentType != _loc8_)
{
this.secondPage.spSecondPage.vPosition = 0;
}
this.currentType = _loc8_;
this.secondPage._visible = true;
this.secondPage.unitTitleTxtObj1.embedFonts = true;
this.secondPage.unitTitleTxtObj2.embedFonts = true;
this.secondPage.theUnitTitle = "Activities: " + _loc8_;
this.activityPage.theUnitTitle = "Activities: " + _loc8_;
this.clearMovies("activeMovieClips");
this.count = 0;
_loc3_ = 0;
while(_loc3_ < _loc4_.length)
{
this.attachMC(2,500,_loc3_ * _loc6_ + 30,_loc4_[_loc3_]);
_loc3_ = _loc3_ + 1;
}
this.secondPage.spSecondPage.setStyle("borderStyle","none");
this.secondPage.spSecondPage.setStyle("backgroundColor",_root.bgColour);
this.currentPage = 2;
}
function homeBtnPress()
{
if(this.currentPage != 0)
{
this.clearActivities();
this.currentUnit = undefined;
this.mainBg._visible = true;
this.firstPage._visible = true;
this.secondPage._visible = false;
this.topNav.printBtn.onRelease = undefined;
this.topNav.printBtn.useHandCursor = false;
}
this.currentPage = 0;
}
function unitBtnPress(id)
{
this.clearActivities();
_root.currId = id;
this.mainBg._visible = true;
this.firstPage._visible = false;
this.activityPage._visible = false;
this.baseNav._visible = false;
this.createUnitNav(id);
this.disablePrintBtn();
}
function selectMenuItem(str)
{
var _loc2_ = {};
_loc2_ = _root.navigation.getUnitInfo(str.split(","));
var _loc3_ = {};
_loc3_.nodeData = _loc2_;
_root.navigation.onFileClicked(_loc3_,false);
}
function clearMovies(arrStr)
{
var _loc2_ = 0;
while(_loc2_ < this[arrStr].length)
{
this[arrStr][_loc2_].swapDepths(0);
this[arrStr][_loc2_].removeTextField();
this[arrStr][_loc2_].removeMovieClip();
_loc2_ = _loc2_ + 1;
}
this[arrStr] = new Array();
}
function initUnitBtn(id)
{
var _loc3_ = this;
this.firstPage["u" + id].id = id;
this.firstPage["u" + id].txtObj.embedFonts = true;
this.firstPage["u" + id].rolledOver = false;
this.firstPage["u" + id].txtObj.text = this.arrData[id].label;
this.firstPage["u" + id].onRelease = function()
{
_root.secondPage.unitPicture.gotoAndStop(id);
_root.navigation.unitBtnClicked(this.id);
};
this.firstPage["u" + id].onRollOver = function()
{
this.gotoAndStop(2);
_root.firstPage.firstPagePicture.gotoAndStop(id);
this.txtObj.embedFonts = true;
};
this.firstPage["u" + id].onRollOut = function()
{
this.gotoAndStop(1);
this.txtObj.embedFonts = true;
};
this.firstPage["u" + id].onReleaseOutside = function()
{
this.gotoAndStop(1);
this.txtObj.embedFonts = true;
};
this.firstPage["u" + id].useHandCursor = false;
}
function fillFirstPage()
{
var _loc4_ = 0;
var _loc7_ = this.arrData.length;
this.firstPage._visible = true;
this.unitBtnTmpArr = new Array();
var _loc5_ = this.firstPage.dummy._x;
var _loc8_ = this.firstPage.dummy._y;
var _loc6_ = 50;
this.firstPage.dummy.swapDepths(0);
this.firstPage.dummy.removeMovieClip();
var _loc3_ = 0;
while(_loc3_ < _loc7_)
{
this.unitBtnTmpArr.push(_loc3_);
if(this.arrData[_loc3_].bFolder || this.arrData[_loc3_].label == "iTest")
{
if(this.arrData[_loc3_].bFolder)
{
this.firstPage.attachMovie("unitBtn","u" + _loc3_,this.firstPage.getNextHighestDepth());
if(_loc8_ + _loc4_ * _loc6_ > _loc7_ / 2 * _loc6_)
{
_loc5_ += 200;
_loc4_ = 0;
}
this.firstPage["u" + _loc3_]._x = _loc5_;
this.firstPage["u" + _loc3_]._y = _loc8_ + _loc4_ * _loc6_;
_loc4_ = _loc4_ + 1;
}
else
{
trace("unitbtn2");
this.firstPage.attachMovie("unitBtn2","u" + _loc3_,this.firstPage.getNextHighestDepth());
this.firstPage["u" + _loc3_]._x = _loc5_;
this.firstPage["u" + _loc3_]._y = _root.firstPage.firstPagePicture._y;
}
}
this.initUnitBtn(_loc3_);
_loc3_ = _loc3_ + 1;
}
this.currentPage = 1;
}
function parseXML(XMLObj)
{
var _loc2_ = 0;
while(_loc2_ < XMLObj.firstChild.childNodes.length)
{
this.arrData[_loc2_].modName = XMLObj.firstChild.childNodes[_loc2_].attributes.title;
this.arrData[_loc2_].description = XMLObj.firstChild.childNodes[_loc2_].firstChild.nodeValue;
_loc2_ = _loc2_ + 1;
}
}
}