flash AS2.0 制作的下拉条 很好拉 非你网:提供

上海/动画师/15年前/3401浏览
flash AS2.0 制作的下拉条 很好拉 非你网:提供
vini123
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
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(txt._y&nbsp;+&nbsp;par&nbsp;*&nbsp;2&nbsp;<=&nbsp;tB)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;txt._y&nbsp;=&nbsp;tB;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;par&nbsp;=&nbsp;0;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;//&nbsp;end&nbsp;if
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;txt._y&nbsp;=&nbsp;txt._y&nbsp;+&nbsp;par&nbsp;*&nbsp;2;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;//&nbsp;end&nbsp;if
&nbsp;&nbsp;&nbsp;&nbsp;};
&nbsp;&nbsp;&nbsp;&nbsp;Mouse.addListener(mcscroll);
&nbsp;&nbsp;&nbsp;&nbsp;this.cursor.onPress&nbsp;=&nbsp;function&nbsp;()
&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_root.scrollState&nbsp;=&nbsp;true;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;startDrag&nbsp;(cursor,&nbsp;false,&nbsp;this._x,&nbsp;cursorTop,&nbsp;this._x,&nbsp;cursorBottom);
&nbsp;&nbsp;&nbsp;&nbsp;};
&nbsp;&nbsp;&nbsp;&nbsp;this.cursor.onRelease&nbsp;=&nbsp;this.cursor.onReleaseOutside&nbsp;=&nbsp;function&nbsp;()
&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_root.scrollState&nbsp;=&nbsp;false;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stopDrag&nbsp;();
&nbsp;&nbsp;&nbsp;&nbsp;};
&nbsp;&nbsp;&nbsp;&nbsp;this.onEnterFrame&nbsp;=&nbsp;function&nbsp;()
&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(_root.scrollState)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.txt._y&nbsp;=&nbsp;x&nbsp;*&nbsp;this.cursor._y&nbsp;+&nbsp;y;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.cursor._y&nbsp;=&nbsp;(this.txt._y&nbsp;-&nbsp;y)&nbsp;/&nbsp;x;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;//&nbsp;end&nbsp;else&nbsp;if
&nbsp;&nbsp;&nbsp;&nbsp;};
};
var&nbsp;txt_aY=txt._y;
var&nbsp;txt_bY=txt._y+(mask._height-txt._height);
var&nbsp;cursor_aY=cursor._y;
var&nbsp;cursor_bY=cursor._y+(mask._height-cursor._height)
scrollBar(85,-274,108,221);
//trace&nbsp;(cursor._x);&nbsp;
&nbsp;
&nbsp;
&nbsp;
虚幻之物对应着冥冥之路……
七月羽歌&nbsp;七月小妖&nbsp;&nbsp;&nbsp;热血江湖&nbsp;热血情怀&nbsp;一辈子的爱恋
&nbsp;
&nbsp;
12
Report
|
4
Share
评论
in to comment
Add emoji
喜欢TA的作品吗?喜欢就快来夸夸TA吧!
推荐素材
You may like
大家都在看
Log in