flash右击菜单
flash右击菜单
this._lockroot = true;
//设置遮罩
_mc.setMask(mask_mc);
xst_mc.setMask(maskxst_mc);
//申明影片剪辑滚动距离变量及按钮和按钮背景影片剪辑的可见性设置
var ypgdjl:Number = _mc._height-mask_mc._height;
if (ypgdjl<=0) {
_btn._visible = 0;
} else {
_btn._visible = 1;
}
//设置一些元件的坐标及按钮的高度
mask_mc._x = mask_mc._y=maskxst_mc._x=maskxst_mc._y=_mc._x=_mc._y=xst_mc._x=xst_mc._y=0;
_btn._height = int(mask_mc._height*((_mc._height-ypgdjl)/_mc._height));
_btn._x = btnbj_mc._x=mask_mc._width;
_btn._y = btnbj_mc._y=mask_mc._y;
//按钮按下开始拖动并设置影片剪辑的坐标
var btntdjl:Number = mask_mc._height-_btn._height;
_btn.onPress = function() {
startDrag(this, false, mask_mc._width, mask_mc._y, mask_mc._width, btntdjl);
_mc.onEnterFrame = function() {
this._y = -(int(_btn._y/btntdjl*ypgdjl));
xst_mc._y = Y+this._y;
}; flash右击菜单
};
_btn.onRelease = _btn.onReleaseOutside=function () {
stopDrag();
};
var biaoti_array:Array = new Array("顶端导航栏","顶端导航栏","顶端导航栏","顶端导航栏","顶端导航栏","顶端导航栏");
//以上根据你的需要去显示菜单
this.createEmptyMovieClip("load_mc", this.getNextHighestDepth());
load_mc._x = 190;
load_mc._y = 0;
var _mcl:MovieClipLoader = new MovieClipLoader();
var load_array:Array = new Array("zhaoxi/dddhl.swf", "zhaoxi/time.swf", "zhaoxi/watch.swf",
"zhaoxi/zcdhl.swf", "zhaoxi/gdt.swf", "zhaoxi/yybfq1.swf", "zhaoxi/yybfq2.swf",
"zhaoxi/yybfq3.swf", "zhaoxi/yybfq4.swf", "zhaoxi/dz.swf", "zhaoxi/yjcd.swf",
"zhaoxi/rydjs.swf", "zhaoxi/jzjdxs.swf", "zhaoxi/fangdajing1.swf",
"zhaoxi/fangdajing2.swf", "zhaoxi/fangdajing3.swf", "zhaoxi/shiping.swf");
//以上是你需要载入文件的路径
xst_mc._visible = 0;
for (i=1; i<53; i++) {
this._mc["bt"+i+"_mc"].stop();
this._mc["bt"+i+"_mc"].id = i;
this._mc["bt"+i+"_mc"].my_txt.textColor = 0xFFFFFF;
this._mc["bt"+i+"_mc"].my_txt.text = biaoti_array[i-1];
this._mc["bt"+i+"_mc"].onRollOver = function() {
this.gotoAndStop(2);
this.my_txt.textColor = 0x000000;
};
this._mc["bt"+i+"_mc"].onPress = function() {
_mcl.loadClip(load_array[this.id-1], load_mc);
Y = (this.id-1)*20;
xst_mc._y = Y+_mc._y;
xst_mc._visible = 1;
};
this._mc["bt"+i+"_mc"].onReleaseOutside = this._mc["bt"+i+"_mc"].onRollOut=function () {
this.gotoAndStop(1);
this.my_txt.textColor = 0xFFFFFF;
};
}
补充:flash教程,动画技术