有白色的线条,是因为,这个底条是50个小图组成,FLASH 处理的时候不是很完美.按理是没有的,也算是个BUG吧 ,你可以自己绘制,就不会有这个问题了.
还有就是请教各位
1:怎么设置创建出来的文本的字体大小(不用scale)
2:怎么获取文本从第一个字到最后一个字的距离
3:文本的bold属性怎么才能对中文有效
源码下载:flash_dock_menu.rar
模仿“css+js” 的那个菜单,舞台大小设置为 640*480 把这段代码插入第一帧(仅一帧)
在库中放入数组 menu_Array 中的名称为连接名的图片 和连接名为 dock_bg2 的图片
//-----------------------------代码--------------------------------------------------
import flash.display.BitmapData;
//-------------------是否缓冲(false/true)---------------------------------------
var huanchong:Boolean = false;
//-------------------若缓冲为真-缓冲大小---------------------------------------
var huanchong_num:Number = 3;
var main_bg:BitmapData = BitmapData.loadBitmap("main_bg");
//-------------------铺背景--------------------------------
for (var j:Number = 0; j<=767; j++) {
this.createEmptyMovieClip("bg_mc"+j, this.getNextHighestDepth());
this["bg_mc"+j].attachBitmap(main_bg, this.getNextHighestDepth());
this["bg_mc"+j]._x = j*20-Math.floor(j/32)*640;
this["bg_mc"+j]._y = Math.floor(j/32)*20;
}
//-----------------链接名称--------------------------------
var menu_Array:Array = new Array();
menu_Array = ["主页", "联系", "Protfolio", "音乐", "电影", "历史", "日历", "链接", "RSS", "RSS2"];
//-----------------创建一个底条位图实例-------------------------
var flash8__kingofkofs:BitmapData = BitmapData.loadBitmap("dock_bg");
//-----------------创建一个MC用来加载位图对象----------------
_root.createEmptyMovieClip("setoff", _root.getNextHighestDepth());
for (var j:Number = 0; j<=menu_Array.length*4-1+2; j++) {
_root.setoff.createEmptyMovieClip("setoff_son"+j, _root.setoff.getNextHighestDepth());
_root.setoff["setoff_son"+j].attachBitmap(flash8__kingofkofs, _root.getNextHighestDepth(), "auto", true);
_root.setoff["setoff_son"+j]._x = j*10-210;
_root.setoff["setoff_son"+j]._y = -60;
_root.setoff._x = Stage.width/2-5;
_root.setoff._y = Stage.height;
_root.setoff._;
_root.setoff.ori_width = _root.setoff._width;
}
//-----------------创建MC以及加载库中的位图---------------------
for (var j:Number = 0; j<=menu_Array.length-1; j++) {
this[img[j]] = BitmapData.loadBitmap(menu_Array[j]);
_root.createEmptyMovieClip(menu_Array[j], _root.getNextHighestDepth());
_root[menu_Array[j]].createEmptyMovieClip("mc", _root.getNextHighestDepth());
_root[menu_Array[j]].mc.attachBitmap(this[img[j]], _root.getInstanceAtDepth(), "auto", true);
_root[menu_Array[j]].mc._;
_root[menu_Array[j]].mc._;
_root[menu_Array[j]].mc._x = -_root[menu_Array[j]]._width/2;
_root[menu_Array[j]].mc._y = -_root[menu_Array[j]]._height;
_root[menu_Array[j]]._x = j*_root[menu_Array[j]]._width+(Stage.width-_root[menu_Array[j]]._width*menu_Array.length)*0.5+15;
_root[menu_Array[j]]._y = Stage.height;
_root[menu_Array[j]].ori_x = _root[menu_Array[j]]._x;
_root[menu_Array[j]].ori_y = _root[menu_Array[j]]._y;
_root[menu_Array[j]].ori_wid = _root[menu_Array[j]]._width;
_root[menu_Array[j]].ori_hei = _root[menu_Array[j]]._height;
//trace(_root[menu_Array[j]].ori_x);
}
var all_wid:Number = 0;
_root.createEmptyMovieClip("point", _root.getNextHighestDepth());
setInterval(function () {
updateAfterEvent();
_root.all_wid = _root[menu_Array[0]]._width+_root[menu_Array[1]]._width+_root[menu_Array[2]]._width+_root[menu_Array[3]]._width+_root[menu_Array[4]]._width+_root[menu_Array[5]]._width+_root[menu_Array[6]]._width+_root[menu_Array[7]]._width+_root[menu_Array[8]]._width+_root[menu_Array[9]]._width;
_root.setoff._width = (_root.all_wid-400)+_root.setoff.ori_width;
if (!huanchong) {
_root.point._x = _xmouse;
_root.point._y = _ymouse;
} else {
_root.point._x += (_xmouse-_root.point._x)/huanchong_num;
_root.point._y += (_ymouse-_root.point._y)/huanchong_num;
}
for (var j:Number = 0; j<=menu_Array.length-1; j++) {
//-------------------计算及设置鼠标滑过时MC的高低----------------
if (_root.point._x>=_root[menu_Array[j]].ori_x && _root.point._x-_root[menu_Array[j]].ori_x<=_root[menu_Array[j]].ori_wid*2.5 && _root.point._y<_root[menu_Array[j]]._y && _root[menu_Array[j]]._y-_root.point._y<=_root[menu_Array[j]].ori_hei*2.5) {
_root["percent_x"+j] = 1-(_root.point._x-_root[menu_Array[j]].ori_x)/(_root[menu_Array[j]].ori_wid*2.5);
_root["percent_y"+j] = 1-((_root[menu_Array[j]]._y-_root[menu_Array[j]].ori_wid)-_root.point._y)/(_root[menu_Array[j]].ori_hei*2.5-20);
if (_root["percent_y"+j]>=1) {
_root["percent_y"+j] = 1;
}
_root["percent_xy"+j] = _root["percent_x"+j]*_root["percent_y"+j];
_root[menu_Array[j]]._percent_xy"+j]*60+40;
_root[menu_Array[j]]._percent_xy"+j]*60+40;
} else if (_root.point._x<_root[menu_Array[j]].ori_x && _root[menu_Array[j]].ori_x-_root.point._x<_root[menu_Array[j]].ori_wid*2.5 && _root.point._y<_root[menu_Array[j]]._y && _root[menu_Array[j]]._y-_root.point._y<=_root[menu_Array[j]].ori_hei*2.5) {
_root["percent_x"+j] = 1-(_root[menu_Array[j]].ori_x-_root.point._x)/(_root[menu_Array[j]].ori_wid*2.5);
_root["percent_y"+j] = 1-((_root[menu_Array[j]]._y-_root[menu_Array[j]].ori_wid)-_root.point._y)/(_root[menu_Array[j]].ori_hei*2.5-20);
if (_root["percent_y"+j]>=1) {
_root["percent_y"+j] = 1;
}
_root["percent_xy"+j] = _root["percent_x"+j]*_root["percent_y"+j];
_root[menu_Array[j]]._percent_xy"+j]*60+40;
_root[menu_Array[j]]._percent_xy"+j]*60+40;
} else if (huanchong) {
_root[menu_Array[j]]._width -= (_root[menu_Array[j]]._width-40)/5;
_root[menu_Array[j]]._height -= (_root[menu_Array[j]]._height-40)/5;
} else {
_root[menu_Array[j]]._;
_root[menu_Array[j]]._;
}
//-------------------菜单提示TXT----------------
_root[menu_Array[j]].onRollOver = function() {
this.menu_name = true;
this.swapDepths(_root.getNextHighestDepth());
};
_root[menu_Array[j]].onRollOut = function() {
this.menu_name = false;
};
if (_root[menu_Array[j]].menu_name) {
_root.createTextField(menu_Array[j]+"txt", _root.getNextHighestDepth(), -10, -40, 50, 30);
_root[menu_Array[j]+"txt"].bold = true;
_root[menu_Array[j]+"txt"].text = menu_Array[j];
_root[menu_Array[j]+"txt"]._xscale = _root[menu_Array[j]+"txt"]._yscale=150;
_root[menu_Array[j]+"txt"].textColor = 0x000000;
_root[menu_Array[j]+"txt"]._x = _root[menu_Array[j]]._x-_root[menu_Array[j]+"txt"]._width/2;
_root[menu_Array[j]+"txt"]._y = Stage.height-_root[menu_Array[j]]._height-20;
_root[menu_Array[j]+"txt"].selectable = false;
} else {
_root[menu_Array[j]+"txt"].removeTextField();
}
}
_root[menu_Array[0]]._x = _root.setoff._x-_root.setoff._width/2+_root[menu_Array[0]]._width/2+10;
for (var j:Number = 1; j<=menu_Array.length-1; j++) {
_root[menu_Array[j]]._x = _root[menu_Array[j-1]]._x+_root[menu_Array[j-1]]._width/2+_root[menu_Array[j]]._width/2;
}
}, 10);
关键字: flash放大镜效果 flash图片效果 flash图片切换效果 flash图片轮换效果 flash图片过渡效果 flash旋转图片效果 flash 图片显示效果 flash制作图片效果 flash图片移动效果 flash图片转换效果
茶杯头甜蜜终章dlc 官方手机版v1.0.0.3
下载火柴人传说暗影格斗内置菜单 最新版v3.0.1
下载荒野乱斗测试服 安卓版v61.10.3
下载荒野乱斗彩虹服 安卓版v61.10.3
下载寒霜启示录 安卓版v1.25.10
寒霜启示录是一款生存模拟游戏,不少玩家可能对于末日都有着自己
末日城堡免广告版 安卓最新版v0.7.1
末日城堡免广告版是一款非常好玩的模拟经营类游戏,内部可以不看
甜蜜人生模拟器 最新版v1.4.5
甜蜜人生模拟器是一款非常好玩的模拟恋爱手游,玩家在这里能够对
武器锻造师内置功能菜单 v10.4
武器锻造师内置菜单版是游戏的破解版本,在该版本中为玩家提供了
开放空间overfield 安卓版v1.0.5
开放空间Overfield是一款箱庭养成经营手游,让你在广阔