As the markets collapsed over the past year, actively managed mutual funds were pummeled. Nearly every equity fund suffered enormous losses — and more than a few bond portfolios also sank into the red. But there were some bright spots. Many funds attracted new assets, while millions of investors showed gumption, avoiding panic and instead keeping their eye on the long-term. Below are some highlights:

Star managers With the S&P 500 sinking, many investors dumped also-ran funds and shifted to some top actively managed portfolios. Eaton Vance Large Cap Value A (EHSTX) and Ivy Asset Strategy C (WASCX) each gained more than $6 billion in net new cash inflows during 2008, according to Morningstar. The list of funds that attracted more than $3 billion included American Funds Fundamental Investors A (ANCFX), CGM Focus (CGMFX) and Fidelity Advisor New Insights A (FNIAX).

Actively managed funds with strong risk-adjusted returns have long appealed to investors, of course, and that has not changed during the recession, says Loren Fox, senior research analyst for Strategic Insight, a fund research firm. “In this environment, there are some investors who feel better when there is an experienced person overseeing the money,” says Fox.

One manager who inspires confidence is Bruce Berkowitz, who has run Fairholme Fund (FAIRX) since 1999. The fund attracted $3.5 billion in flows during 2008. For five consecutive years through 2008, Fairholme clobbered the S&P 500 by wide margins. Berkowitz compiled the record by focusing on solid businesses with strong franchises. Last year he avoided some of the worst trouble by steering away from financial companies with big derivatives positions.

Index funds Some disillusioned investors shifted away from weak active portfolios to index mutual funds and exchange-traded funds. The top asset gatherer of 2008 was Vanguard Total Stock Market Index (VTSMX), which had $15.9 billion in asset flows. Altogether Vanguard attracted $39 billion to its index funds, while Fidelity Investments had $6.2 billion in index flows; John Hancock drew $2.5 billion, according to Strategic Insight.

Can index and top active funds continue prospering at the same time? Yes, says Fox of Strategic Insight. “Not all investors want the same things,” says Fox. “Some people are disillusioned with active funds, and they want index funds with low fees.”

Some of the strongest flows went to exchange-traded funds (ETFs), which mainly track indexes. In 2008, ETFs drew a record $176 billion in inflows, up from the previous record of $150 billion in 2007. ETFs proved particularly popular because they offer convenient ways to profit from market downturns. Investors can sell funds short or buy inverse ETFs, which rise when stocks decline.

Steadfast investors One of the worst months on record came in October when $126 billion in assets left funds. While the figure was troubling, it represented less than 1.5 percent of the $9.5 trillion in assets in funds. So even in a very dark moment, the huge majority of investors kept their fund investments intact. The stability can be partly attributed to advisors and other experts who have preached the need to invest for the long-term.

Among the steadiest investors were those in 401(k)s and other retirement plans, which account for more than 60 percent of all equity fund assets. Retirement savers tend to make systematic deposits and few withdrawals during working years. In 2008, only 3.7 percent of 401(k) participants stopped contributing to their plans, according to a survey of 22 million accounts by the Investment Company Institute (ICI), the mutual fund trade group. “Retirement savers are committed to investing,” says Sarah Holden, director of retirement and investor research for the ICI. “The pattern of consistent investing last year was similar to what we have seen in past bear markets.”

The average 401(k) account balance dropped from $79,000 at the end of 2007 to $65,000 a year later, according to Hewitt. That was a respectable showing in a year when the S&P 500 lost 37.0 percent. Why didn't account values drop along with the market? Participants owned some bonds — and they continued investing throughout the downturn, buying as stocks fell. The average saver deposited $5,600 in 2008, according to Fidelity Investments. By continuing to save, account holders can rebuild their accounts back to the old highs in a matter of years.

Staying diversified Part of the credit for the relatively strong showing of 401(k) accounts must go to employers who have been urging participants to diversify. Employers have long made matching contributions in company stock and encouraged participants to hold company stock in other ways. But lately, more companies have been emphasizing the importance of holding bonds and diversified stock funds.

The efforts by employers helped cushion investors in the downturn. By the end of 2008, only 16 percent of participants had all their assets in stocks, down from 37 percent in 2000, according to Fidelity. Fixed income accounted for 53.8 percent of assets at the end of last year, compared to 74.2 percent at the height of the bull market in 2000. Employer stock accounted for 10 percent of assets, down from 20 percent in 2000.

To encourage diversification, many plans have been introducing target date funds, which hold balanced mixes of stocks and bonds. In the typical target strategies, fund companies offer portfolios with different retirement dates, such as 2020, 2030 and so on.

The target date funds have emerged as one of the fastest growing categories. Now 77 percent of employers offer target date funds, up from 66 percent a year ago. Flows into the funds reached $41.5 billion in 2008.

The target funds suffered big losses, but because of diversification, many of them outdid the S&P 500 by significant margins. One average, funds with target dates ranging from 2011 to 2015 lost 28.5 percent, beating the S&P by 8.5 percentage points, according to Morningstar. Funds with better than average results included American Century Livestrong 2015 (ARFIX), Federated Target ETF 2015 (FTQAX) and Vanguard Target Retirement 2015 (VTXUX).

Unlike Madoff At a time of collapsing institutions and vanishing nest eggs, major fund companies — such as Fidelity and T. Rowe Price — remain on sound footing. The companies have stayed profitable by doing what they have always done, offering retail investors diversified investments at reasonable costs. Just as important, fund companies provide honest record keeping. In the wake of the Madoff scandals, honesty is a virtue that investors have come to prize.