flash AS2.0 制作的下拉条 很好拉 非你网:提供
上海/动画师/15年前/3401浏览
版权
flash AS2.0 制作的下拉条 很好拉 非你网:提供
AS2.0 下拉代码: www.vini123.com 非你网提供
说明: txt为文字剪辑的剪辑名,mask为文字剪辑的遮罩,cursor为下拉头。
注意: 建立剪辑,最初的时候,把注册点最好放在右上角,都用(0,0)。这样容易对其。该下拉条代码简
单,只要在代码最后一行,修改四个数字就可以修改任何遮罩内容的下拉条控制。
scrollBar(85,-274,108,221);
85为文字剪辑的初始纵坐标,-274为文字剪辑下拉到最低端的文字剪辑的纵坐标。
108为下拉头的初始纵坐标,221为下拉头下拉到最低端的纵坐标。
只需将名字取好,修改这四个参数,就能做出非常标准的下拉条。
我也是一个flash爱好者,也在学习中,技术不好。AS3.0的下拉条代码也有,如果有需要,请联系。
有喜欢的朋友,谢谢支持哦。
//this.txt.setMask(mask);//设置文本被遮罩.
cursor._x=394;
_root.scrollState = false;
scrollBar = function (txtTop, txtBottom, cursorTop, cursorBottom)
{
var x = y = 0;
var tT = txtTop;//tT为文本的至高点坐标;
var tB = txtBottom;//tB为文本的底坐标;
var _loc3 = cursorTop;//_loc3为拉条的顶点坐标;
var _loc4 = cursorBottom;//_loc4为拉条的底坐标;
x = (tB - tT) / (_loc4 - _loc3);//x=(文本底坐标-文本的高坐标)/(拉条底坐标-拉条顶坐标)的商;
y = -x * _loc3 + tT;//y为(-x)*(拉条顶点坐标)+文本
mcscroll = new Object();
mcscroll.onMouseWheel = function (par)
{
if (!_root.scrollState)
{
if (txt._y + par * 2 >= tT)
{
txt._y = tT;
par = 0;
} // end if
if (txt._y + par * 2 <= tB)
{
txt._y = tB;
par = 0;
} // end if
txt._y = txt._y + par * 2;
} // end if
};
Mouse.addListener(mcscroll);
this.cursor.onPress = function ()
{
_root.scrollState = true;
startDrag (cursor, false, this._x, cursorTop, this._x, cursorBottom);
};
this.cursor.onRelease = this.cursor.onReleaseOutside = function ()
{
_root.scrollState = false;
stopDrag ();
};
this.onEnterFrame = function ()
{
if (_root.scrollState)
{
this.txt._y = x * this.cursor._y + y;
}
else
{
this.cursor._y = (this.txt._y - y) / x;
} // end else if
};
};
var txt_aY=txt._y;
var txt_bY=txt._y+(mask._height-txt._height);
var cursor_aY=cursor._y;
var cursor_bY=cursor._y+(mask._height-cursor._height)
scrollBar(85,-274,108,221);
//trace (cursor._x);
虚幻之物对应着冥冥之路……
七月羽歌 七月小妖 热血江湖 热血情怀 一辈子的爱恋
12
Report
声明
4
Share
in to comment
Add emoji
喜欢TA的作品吗?喜欢就快来夸夸TA吧!
You may like
Log in
12Log in and synchronize recommended records
4Log in and add to My Favorites
评论Log in and comment your thoughts
分享Share







































