Function help

Hey everyone, I’ve got a quick question regarding some of the functions I’m writing. Basically this function is not working when I call it, but actually runs when the frame loads and returns the trace data requested in the function.

Here’s the function:

function loadNewProj(projNumber:Number) {
    portfolioMain.projTitleTxt.text = _root.projArray[projNumber].projTitle;
    portfolioMain.projDescTxt.text = _root.projArray[projNumber].projDesc;
    portfolioMain.projTypeTxt.text = _root.projArray[projNumber].projType;
    trace(_root.projArray[projNumber].projType);
    trace(projNumber);
}

…and an example of how I’m calling it:

portfolioMain.wwwBtn.onRelease = loadNewProj(1);

I’m using the same function for about 12 different movieclips, so I realize this might be easier to do with a class than a function. However… I’m new to the OOP realm and I’m under the gun to finish this project (read: due tomorrow). Anyone have any suggestions? I can’t grasp why the function would run and work when the frame loads, but then not work when its called later on. Thanks. :thumb: