I need help understanding a function

Hello,

I’m walking in to someone else’s code and I have no idea how to fix this…

The idea is that you are supposed to click a button (my_photos) and it should load images off a server based on a login. According to this code, my_photos calls function myClick onRelease. This is where I think the issue is, but I’m not sure.

I would appreciate any help I can get.

Thanks,

–thesprucegoose


restrict
import mx.transitions.easing.*;
ZigoEngine.register(Fuse, FuseFMP);

import com.mosesSupposes.fuse.*;
ZigoEngine.simpleSetup(Shortcuts, PennerEasing);
import flash.geom.Rectangle;
//import flash.display.*
displayDepth;
theRoot = this;
rootPath = "http://cias.rit.edu/~deepocean/site/"
imagePath = rootPath + "images/"

superClip;
theRoot.dispType
//(theRootIn, imagePathIn, thumbHeightIn, thumbWidthIn, sizeOnWidth, imageSpaceIn, startYIn, numPicsY, numPicsX, borderWidthIn)
function callPHP(searchString, fieldName){
    if(thumbMan!=undefined){
        delete thumbMan;
        delete myIS;
    }
    
    thumbMan = new ThumbManager();
    myIS = new ImageStructure(this, imagePath, 80, 60, true, 20, 155, 0, 5, 5, 4);
    var load_var:LoadVars = new LoadVars();// create LoadVars Obj to send.
    load_var.searchString = searchString
    load_var.fieldName =  fieldName;
    load_var.sendAndLoad(rootPath + "pics.php", theRoot.doc, "GET")
        //call send and Load to the php file that receives the information
        //theRoot.doc is the XML that will receive the PHP file's output.
    
}
doc = new XML();
doc.ignoreWhite = true;
tarce_txt.text =" " ;
function tarce(string){
    
    //trace_txt.text += newline + string.toString();
    
    
}
myArray = new Array();
doc.onLoad = function (success){
    trace(doc);
    if(success){
        myArray = new Array();
        tarce("XML loaded ------------------------>");
        for(j=0; j < 5; j++){
            var xmlTargNode = doc.childNodes[0].childNodes[0]
            for(i=0;i<xmlTargNode.childNodes.length;i++){//parse through the XML
                tempObj = new Object();
                
                tempObj.mySrc = xmlTargNode.childNodes*.attributes.image_source
                tempObj.myID = xmlTargNode.childNodes*.attributes.image_id
                tempObj.myWidth = xmlTargNode.childNodes*.attributes.image_width
                tempObj.myHeight = xmlTargNode.childNodes*.attributes.image_height
                //tarce(tempObj.mySrc);
                myArray.push(tempObj);
            }
        }
        myIS.loadImages(myArray);// call the function that putes the images on  the stage
    }else{
        
        
    }
    
}
function myClick(){
    if(theRoot.dispType != "m"&&theRoot.dispType != "e"){
        theRoot.dispType = "m";
        callPHP("sharks", "c.category_name");
        theRoot.imageHolder.removeMovieClip()
        removeMovieClip(theRoot.theBClip)
    }
}
function stockClick(){
    trace(theRoot.dispType);
    if(theRoot.dispType != "s"&&theRoot.dispType != "e"){
        
        theRoot.dispType = "s";
        callPHP("", "c.category_name");
        theRoot.imageHolder.removeMovieClip()
    }
}
myObj = new Object();
//myObj.onMouseMove = checkMouse;
myRollIn = setInterval(this, "checkMouse", 10);
myObj.theRoot = this;
mcCheckArr = new Array();
function addMouseCheck(newMC, coverMC){
    Mouse.addListener(myObj);
    newMC.over_mc = false;
    var tempObj = new Object();
    tempObj.rollMC = newMC;
    tempObj.coverMC = coverMC;
    mcCheckArr.push(tempObj);
}
    
function checkMouse(){
    //trace("move " + this.theRoot.mcCheckArr.length);
    for(var i =0; i<this.theRoot.mcCheckArr.length;i++){
        
                //this.theRoot.mcCheckArr*.rollMC._x ++;
        ///trace(this.theRoot.mcCheckArr*.coverMC.hitTest(this.theRoot._xmouse,this.theRoot._ymouse, true));
        if(this.theRoot.mcCheckArr*.rollMC.hitTest(_root._xmouse,_root._ymouse, true)&&this.theRoot.mcCheckArr*.coverMC.hitTest(_root._xmouse,_root._ymouse, false)){
            
            if(!mcCheckArr*.rollMC.over_mc){
                trace(mcCheckArr*.rollMC.over_mc);
                //mcCheckArr*.rollMC._y = 100;
                mcCheckArr*.rollMC.fauxRollOver()
                mcCheckArr*.rollMC.over_mc = true;
            }
        }else{
            if(mcCheckArr*.rollMC.over_mc){
                trace(mcCheckArr*.rollMC.over_mc);
                mcCheckArr*.rollMC.fauxRollOut()
                mcCheckArr*.rollMC.over_mc = false;
            }
        }
        
        
        
    }
    
}

function tabRollOver(){
    this.tween("_y", this.myY-4 , .25, "easeOutSine");
}
function tabRollOut(){
    this.tween("_y", this.myY , .25, "easeOutSine");
}
//doc.load(rootPath +  "pics.php");// load all the pictures at first.
//callPHP("dolphins");
myClick();

function tab_behavior(mc){
        //trace(mc);
    mc.myY = mc._y
    mc.onRollOver = tabRollOver;
    mc.onRollOut = tabRollOut;
}
tab_behavior(titleTabs_mc.my_photos)
tab_behavior(titleTabs_mc.stock_photos)
tab_behavior(exploreTabs_mc.about_mc)
tab_behavior(exploreTabs_mc.desc_mc)
tab_behavior(exploreTabs_mc.behavior_mc)

exploreTabs_mc.myY = exploreTabs_mc._y
titleTabs_mc.myY = titleTabs_mc._y

titleTabs_mc.my_photos.onRelease = myClick;
titleTabs_mc.stock_photos.onRelease = stockClick;

exploreTabs_mc.about_mc.onRelease = function(){
    this._parent._parent.explore_screen.fadeNewText("a");
}
exploreTabs_mc.desc_mc.onRelease = function(){
    //trace(this.explore_screen);
    this._parent._parent.explore_screen.fadeNewText("d");
}
exploreTabs_mc.behavior_mc.onRelease = function(){
    this._parent._parent.explore_screen.fadeNewText("b");
}


fadeNewText(type)
tabsArray = new Array()
tabsArray.push(titleTabs_mc);
tabsArray.push(exploreTabs_mc);
function raiseTabs(raiseMCs){
    var raiseMC = this[raiseMCs]
    for (var j=0;j<tabsArray.length;j++){
        tabsArray[j].tween("_y", tabsArray[j].myY, .5, "easeOutSine", 0);
    }
    raiseMC.tween("_y", raiseMC.myY-38, .5, "easeOutSine", 1);
}
raiseTabs("titleTabs_mc");