#32002/5/17 16:17:18
此处命令写在场景第一帧中
凡是名字都是临时取的
_root.numBox=4;
function ScaleMov (Rate, Name, XScale, YScale) {
// Rate defines how fast the movie clip resizes (0 -> 4)
// Name defines the movie clip to scale , ex. _root.target_clip
// XScale defines the x scale of the movie clip to scale to
// YScale defines the y scale of the movie clip to scale to
if (Name.scale == 1) {
// scale up
setProperty (Name, _xscale, Name._xscale += ((XScale*Rate)-(Name._xscale*Rate))*(Rate/10));
setProperty (Name, _yscale, Name._yscale += ((YScale*Rate)-(Name._yscale*Rate))*(Rate/10));
}
if (Name.scale == 0) {
// scale back down to original size
setProperty (Name, _xscale, Name._xscale += ((Rate*100)-(Name._xscale*Rate))*(Rate/10));
setProperty (Name, _yscale, Name._yscale += ((Rate*100)-(Name._yscale*Rate))*(Rate/10));
}
}
function ScaleMore(Rate, Name, XScale, YScale)
{
// on click, sclae more
if(Name.scale ==2)
{
setProperty (Name, _xscale, Name._xscale += ((XScale*Rate)-(Name._xscale*Rate))*(Rate/10));
setProperty (Name, _yscale, Name._yscale += ((YScale*Rate)-(Name._yscale*Rate))*(Rate/10));
}
}
stop();
stop();
分别建立按钮
在建立MC MC命令如下:
on (rollOver) {
if (this.scale == 0) {
// expand
this.scale = 1;
// fade
_parent.text.gotoAndStop(2);
_parent.fade.gotoAndPlay(2);
}
}
on (release) {
if (this.scale == 1) {
// expand more
this.scale = 2;
// fade
_parent.text.gotoAndStop(3);
_parent.fade.gotoAndPlay(2);
} else if (this.scale == 2) {
// close to title
this.scale = 1;
// fade
_parent.text.gotoAndStop(2);
_parent.fade.gotoAndPlay(2);
}
// close all other menu items
name = _parent._name;
number = Number(name.charAt(3));
for (i=1; i<=_root.numBox; i++) {
if (i != number) {
set ("_root.box" add i add ".box.scale", "0");
tellTarget("_root.box" add i add ".text")
{
gotoAndStop(1);
}
}
}
}
on (rollOut) {
if (this.scale == 1) {
// close
this.scale = 0;
// fade
_parent.text.gotoAndStop(1);
_parent.fade.gotoAndPlay(2);
}
}
然后建立第二个MC用于调用ALPHE 使响应区域不可见
MC 第一帧 stop
MC 第二帧 setProperty(_parent.text,_alpha,0);
第三:alpha= getProperty(_parent.text,_alpha)
if(alpha<100)
{
setProperty(_parent.text,_alpha,alpha+5);
}
else
{
gotoAndStop(1);
}
第四
gotoAndPlay ("fadein");
打完收工