flashxml.txt

来自「请认真阅读您的文件包然后写出其具体功能(至少要20个字)。尽量不要让站长把时间都」· 文本 代码 · 共 2,207 行 · 第 1/5 页

TXT
2,207
字号
} // End of the function
for (i = 1; i <= numOfImage; i++)
{
    imageSet.attachMovie("image", i, i);
    imageSet[i].gotoAndStop(i);
    imageSet[i]._x = (i - 1) % 3 * widthOfImage;
    imageSet[i]._y = Math.floor((i - 1) / 3) * heightOfImage;
    imageSet[i].onRollOver = function ()
    {
        clearInterval(interval);
    };
    imageSet[i].onRollOut = function ()
    {
        interval = setInterval(this._parent._parent, "fun1", gap);
    };
    imageSet[i].onRelease = this[i].onRelease = function ()
    {
        getURL(link[this._name], frame[this._name]);
    };
    this[i].stop();
    this[i].onRollOver = function ()
    {
        var _l1 = this;
        _l1._parent[counter].gotoAndStop(1);
        _l1.gotoAndPlay(2);
        counter = Number(_l1._name);
        clearInterval(interval);
    };
    this[i].onRollOut = this[i].dragOut = function ()
    {
        interval = setInterval(this._parent, "fun1", gap);
    };
} // end of for
imageSet.onEnterFrame = function ()
{
    var _l1 = this;
    var _l3 = -(_l1[counter]._x - leftMargin);
    _l1.x = 0.300000 * _l1.x + (_l3 - _l1._x) * 0.300000;
    _l1._x = _l1._x + _l1.x;
    var _l2 = -(_l1[counter]._y - topMargin);
    _l1.y = 0.300000 * _l1.y + (_l2 - _l1._y) * 0.300000;
    _l1._y = _l1._y + _l1.y;
};
interval = setInterval(this, "fun1", gap);
this[counter].gotoAndPlay(2);
--------------------------------------------------------------
a.做一白色图层方块K
b.做4帧1234,K为背景层名为preImage
c.做一空影辑a放在image剪辑中
在1,2,3,4帧中加入动作
stop();
a.loadMovie(imageURL[this._currentframe]);
d.再做一剪辑PIC分别入preimaget和image
在第一帧中加动作
preImage.gotoAndStop(this._name);
第二帧中加动作
image.gotoAndStop(this._name);
第15帧动作
stop();
e.做一遮罩层AA,被遮罩是PIC1,PIC2,PIC3,PIC4
第一帧是空白帧动作
function linkClean(temp)
{
    temp = String(temp);
    var i = 0;
    while (i < temp.length)
    {
        if (temp.substr(i, 5) == "apos;")
        {
            temp = temp.substr(0, i - 1) + "\'" + temp.substr(i + 5);
        } // end if
        i++;
    } // end while
    var i = 0;
    while (i < temp.length)
    {
        if (temp.substr(i, 4) == "amp;")
        {
            temp = temp.substr(0, i - 1) + "&" + temp.substr(i + 4);
        } // end if
        i++;
    } // end while
    return(temp);
} // End of the function
_global.numOfImage = 4;
inter = 30;
imageHeight = 180;
gap = 3000;
myXML = new XML();
myXML.load("end.xml");
System.useCodepage = true;
_global.imageURL = new Array();
_global.link = new Array();
_global.targetFrame = new Array();
myXML.ignoreWhite = true;
myXML.onLoad = function (temp)
{
    _global.playType = Number(String(this.childNodes[0].childNodes[0]));
    _global.gap = Number(String(this.childNodes[1].childNodes[0])) * 1000;
    for (i = 1; i <= numOfImage; i++)
    {
        _global.imageURL[i] = this.childNodes[i + 1].childNodes[0].childNodes[0];
        _global.link[i] = this.childNodes[i + 1].childNodes[1].childNodes[0];
        _global.targetFrame[i] = this.childNodes[i + 1].childNodes[2].childNodes[0];
        link[i] = linkClean(link[i]);
    } // end of for
    gotoAndStop(2);
};
stop();
第二帧动作
function fun1()
{
    _root[current].gotoAndStop(1);
    if (current == numOfImage)
    {
        current = 1;
    }
    else
    {
        current++;
    } // end if
    _root[current].gotoAndPlay(2);
} // End of the function
current = 1;
for (i = 1; i <= numOfImage; i++)
{
    this[i]._x = 0;
    this[i].stop();
    this[i].onRollOver = function ()
    {
        clearInterval(interval);
        if (current != this._name)
        {
            _root[current].gotoAndStop(1);
            current = Number(this._name);
            _root[current].gotoAndPlay(2);
        } // end if
    };
    this[i].onRollOut = this[i].onDragOut = function ()
    {
        interval = setInterval(fun1, gap);
    };
    this[i].onRelease = function ()
    {
        getURL(link[this._name], targetFrame[this._name]);
    };
} // end of for
this[current].gotoAndPlay(2);
interval = setInterval(fun1, gap);
this.onEnterFrame = function ()
{
    for (i = 1; i <= numOfImage; i++)
    {
        if (current <= i)
        {
            this[i].temp = (i - 1) * inter;
            continue;
        } // end if
        this[i].temp = -imageHeight + i * inter;
    } // end of for
    for (i = 1; i <= numOfImage; i++)
    {
        this[i]._y = this[i]._y + (this[i].temp - this[i]._y) / 4;
    } // end of for
};
-------------------------------------------------------------------
a.做一剪辑A有123456789帧,在第一帧动作
gotoAndStop(this._parent._name);
b.做B里放A,在第11帧动作stop();
c.在场景第一空白帧动作
function linkClean(temp)
{
    temp = String(temp);
    var i = 0;
    while (i < temp.length)
    {
        if (temp.substr(i, 5) == "apos;")
        {
            temp = temp.substr(0, i - 1) + "\'" + temp.substr(i + 5);
        } // end if
        i++;
    } // end while
    var i = 0;
    while (i < temp.length)
    {
        if (temp.substr(i, 4) == "amp;")
        {
            temp = temp.substr(0, i - 1) + "&" + temp.substr(i + 4);
        } // end if
        i++;
    } // end while
    return(temp);
} // End of the function
_global.numOfImage = 8;
_global.heightOfImage = 50;
_global.speed = 3.500000;
myXML = new XML();
myXML.load("end.xml");
System.useCodepage = true;
_global.imageURL = new Array();
_global.link = new Array();
_global.targetFrame = new Array();
myXML.ignoreWhite = true;
myXML.onLoad = function (temp)
{
    _global.playType = Number(String(this.childNodes[0].childNodes[0]));
    _global.gap = Number(String(this.childNodes[1].childNodes[0])) * 1000;
    for (i = 1; i <= numOfImage; i++)
    {
        _global.imageURL[i] = this.childNodes[i + 1].childNodes[0].childNodes[0];
        _global.link[i] = this.childNodes[i + 1].childNodes[1].childNodes[0];
        _global.targetFrame[i] = this.childNodes[i + 1].childNodes[2].childNodes[0];
        link[i] = linkClean(link[i]);
    } // end of for
    gotoAndStop(2);
};
stop();

d.在第二帧动作
function fun1()
{
    this[counter].gotoAndStop(1);
    if (playType == 1)
    {
        counter++;
        if (counter == numOfImage + 1)
        {
            counter = 1;
        } // end if
    }
    else if (playType == 2)
    {
        if (counter == numOfImage)
        {
            uni = -1;
        }
        else if (counter == 1)
        {
            uni = 1;
        } // end if
        counter = counter + uni;
    } // end if
    this[counter].gotoAndPlay(2);
} // End of the function
counter = 1;
for (i = 1; i <= numOfImage; i++)
{
    imageSet.attachMovie("image", i, i);
    imageSet[i].gotoAndStop(i);
    imageSet[i]._x = 0;
    imageSet[i]._y = i * heightOfImage - 10;
    imageSet[i].onRollOver = function ()
    {
        clearInterval(interval);
    };
    imageSet[i].onRollOut = function ()
    {
        interval = setInterval(this._parent._parent, "fun1", gap);
    };
    imageSet[i].onRelease = this[i].onRelease = function ()
    {
        getURL(link[this._name], targetFrame[this._name]);
    };
    this[i].stop();
    this[i].onRollOver = function ()
    {
        if (counter != this._name)
        {
            this._parent[counter].gotoAndStop(1);
            this.gotoAndPlay(2);
        } // end if
        counter = Number(this._name);
        clearInterval(interval);
    };
    this[i].onRollOut = this[i].dragOut = function ()
    {
        interval = setInterval(this._parent, "fun1", gap);
    };
} // end of for
imageSet.onEnterFrame = function ()
{
    var temp = -(counter - 1) * heightOfImage;
    this.y = 0.650000 * this.y + (temp - this._y) * 0.100000;
    this._y = this._y + this.y;
};
interval = setInterval(this, "fun1", gap);
this[counter].gotoAndPlay(2);

e.B层上放一遮罩层,再上放A
=========================================================
a.做5个按钮btn1,btn2,btn3,btn4,btn5
第一帧动作stop();
b.再做一按钮剪辑goto
c.场景第一空白帧动作
w = 0;
_quality = "BEST";
System.useCodepage = true;

d.第二帧动作
function changepics1()
{
    loadimg_mc.loadMovie(pic_list[0].url);
    urls = pic_list[0].link;
} // End of the function
function changepics2()
{
    loadimg_mc.loadMovie(pic_list[1].url);
    urls = pic_list[1].link;
} // End of the function
function changepics3()
{
    loadimg_mc.loadMovie(pic_list[2].url);
    urls = pic_list[2].link;
} // End of the function
function changepics4()
{
    loadimg_mc.loadMovie(pic_list[3].url);
    urls = pic_list[3].link;
} // End of the function
function changepics5()
{
    loadimg_mc.loadMovie(pic_list[4].url);
    urls = pic_list[4].link;
} // End of the function
function autochange()
{
    trace("w0=" + w);
    loadimg_mc.loadMovie(_root.pic_list[w].url);
    attachMovie("mask", "mask", this.getNextHighestDepth());
    if (w == 1)
    {
        urls = pic_list[1].link;
        btn1.gotoAndStop(1);
        btn2.gotoAndStop(2);
        btn3.gotoAndStop(1);
        btn4.gotoAndStop(1);
        btn5.gotoAndStop(1);
    } // end if
    if (w == 2)
    {
        urls = pic_list[2].link;
        btn1.gotoAndStop(1);
        btn2.gotoAndStop(1);
        btn3.gotoAndStop(2);
        btn4.gotoAndStop(1);
        btn5.gotoAndStop(1);
    } // end if
    if (w == 3)
    {
        urls = pic_list[3].link;
        btn1.gotoAndStop(1);
        btn2.gotoAndStop(1);
        btn3.gotoAndStop(1);
        btn4.gotoAndStop(2);
        btn5.gotoAndStop(1);
    } // end if
    if (w == 4)
    {
        urls = pic_list[4].link;
        btn1.gotoAndStop(1);
        btn2.gotoAndStop(1);
        btn3.gotoAndStop(1);
        btn4.gotoAndStop(1);
        btn5.gotoAndStop(2);
    } // end if
    if (w == 0)
    {
        urls = pic_list[0].link;
        btn1.gotoAndStop(2);
        btn2.gotoAndStop(1);
        btn3.gotoAndStop(1);
        btn4.gotoAndStop(1);
        btn5.gotoAndStop(1);
    } // end if
    w++;
    if (w == 5)
    {
        w = 0;
    } // end if
} // End of the function
function moveyuan1()
{
    btn1.gotoAndStop(2);
    btn2.gotoAndStop(1);
    btn3.gotoAndStop(1);
    btn4.gotoAndStop(1);
    btn5.gotoAndStop(1);
    w = 1;
} // End of the function
function moveyuan2()
{
    btn1.gotoAndStop(1);
    btn2.gotoAndStop(2);
    btn3.gotoAndStop(1);
    btn4.gotoAndStop(1);
    btn5.gotoAndStop(1);
    w = 2;
} // End of the function
function moveyuan3()
{
    btn1.gotoAndStop(1);
    btn2.gotoAndStop(1);
    btn3.gotoAndStop(2);
    btn4.gotoAndStop(1);
    btn5.gotoAndStop(1);
    w = 3;
} // End of the function
function moveyuan4()
{
    btn1.gotoAndStop(1);
    btn2.gotoAndStop(1);
    btn3.gotoAndStop(1);
    btn4.gotoAndStop(2);
    btn5.gotoAndStop(1);
    w = 4;
} // End of the function
function moveyuan5()
{
    btn1.gotoAndStop(1);
    btn2.gotoAndStop(1);
    btn3.gotoAndStop(1);
    btn4.gotoAndStop(1);
    btn5.gotoAndStop(2);
    w = 0;
} // End of the function
stop();
var pic_xml = new XML();
var imgd = 0;
var urls;
var k = 0;
var r = 0;
var e = 0;
var z = 0;
var end = 0;
var os = 0;
Stage.align = "TL";
var pic_list = new Array();
pic_xml.ignoreWhite = true;
pic_xml.onLoad = function (success)
{
    if (success)
    {

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?