1.flashäºçº§å¯¼èªèå代ç ï¼å¸®å¿ç¿»è¯ä¸ï¼ï¼
flashäºçº§å¯¼èªèå代ç ï¼å¸®å¿ç¿»è¯ä¸ï¼ï¼
//建ç«æ°ç»å¹¶å å¦å 容
link
=
new
Array();
link[1]
=
"menu/sub1/sub1.htm";
link[2]
=
"menu/sub2/sub1.htm";
link[3]
=
"menu/sub3/sub1.htm";
link[4]
=
"menu/sub4/sub1.htm";
link[5]
=
"menu/sub5/sub1.htm";
link[6]
=
"menu/sub6/sub1.htm";
link[7]
=
"menu/sub7/sub1.htm";
//7个èå
对åéèµå¼
numOfMenu
=
7;
topMargin
=
this[1]._y;
gap
=
;
speed
=
5;
location
=
[,菜菜单html导航页面源码
,
,
,
,
];
_global.active
=
PageNum;
//å¤æ该å¼æ¯å¦ä¸ºç©ºï¼ç»éªçæ¯èåæ¯å¦è¢«ç¹ï¼
对åéèµå¼
if
(!active)
{
_global.active
=
0;
}
//
end
if
_global.subActive
=
subNum;
_global.over
=
active;
//循ç¯
for
(i
=
1;
i
<=
numOfMenu;
i++)
{
//ä½ç§»è®¡ç®
this[i].defaultY
=
(i
-
1)
*
gap
+
topMargin;
this[i].bg.onRollOver
=
function
()
{
_global.over
=
this._parent._name;
};
//å½æ»ç¦»èå
this[i].bg.onRollOut
=
this[i].bg.onDragOut
=
function
()
{
_global.over
=
active;
};
//å½æä¸èå
this[i].bg.onRelease
=
function
()
{
//è¿æ¥å°æ°ç»éçå°å
getURL(link[this._parent._name],
"_self");
};
this[i].onEnterFrame
=
function
()
{
//å¤æ
åªä¸ªèå
if
(over
==
this._name)
{
//移å°ä¸ä¸ç
this.nextFrame();
this.direction
=
"next";
}
else
{
//åç移åæ¥
this.prevFrame();
this.direction
=
"prev";
}
//
end
if
};
}
//
end
of
for
//循ç¯å¤æ
for
(i
=
2;
i
<=
numOfMenu;
i++)
{
if
(over)
{
if
(this[i]._name
<=
over)
{
this[i].targetY
=
this[i].defaultY;
}
else
{
this[i].targetY
=
this[i].defaultY
+
location[over
-
1]
-
gap;
}
//
end
if
}
else
{
this[i].targetY
=
this[i].defaultY;
}
//
end
if
this[i]._y
=
this[i].targetY;
}
//
end
of
for
this.onEnterFrame
=
function
()
{
for
(i
=
2;
i
<=
numOfMenu;
i++)
{
if
(over)
{
if
(this[i]._name
<=
over)
{
this[i].targetY
=
this[i].defaultY;
}
else
{
this[i].targetY
=
this[i].defaultY
+
location[over
-
1]
-
gap;
}
//
end
if
continue;
}
//
end
if
this[i].targetY
=
this[i].defaultY;
}
//
end
of
for
for
(i
=
2;
i
<=
numOfMenu;
i++)
{
//移å¨é度ç计ç®
this[i]._y
=
this[i]._y
+
(this[i].targetY
-
this[i]._y)
/
speed;
}
//
end
of
for
for
(i
=
1;
i
<=
numOfMenu
-
1;
i++)
{
//尺寸ååç计ç®
this[i].mask._yscale
=
this[i
+
1]._y
-
this[i]._y;
}
//
end
of
for
};