主题:  新浪体育频道首页左上角FLASH调用图片新闻的问题

lizhi0075

职务:普通成员
等级:1
金币:0.0
发贴:15
注册:2004/4/14 17:36:26
#12006/9/1 15:45:25
新浪体育频道网址http://sports.sina.com.cn/
左上角的flash调用图片新闻的变换,我会用在自己网站上,但是不知道如何修改显示的文字的样式和行数。他默认的只有1行,连接的样式是红色。如何变成多行呀!因为图片新闻的标题比较长,想多行显示。
我把flash反编译,得到的AS。大家看以下怎么改。外部的JS没有能改的。应该是flash里的AS控制的行数和色彩
AS如下:
function strtoarray(str, myarray) {
    while (str.indexOf("|") != -1) {
        myarray.push(str.slice(0, str.indexOf("|")));
        var Register_1_ = str.slice((str.indexOf("|") + 1));
    }
    myarray.push(Register_1_);
    return myarray;
}
function replinkad(linkarray) {
    var Register_1_ = undefined;
    var Register_3_ = undefined;
    var Register_1_ = 0;
    while (Register_1_ < linkarray.length) {
        while (linkarray[Register_1_].indexOf("^") != -1) {
            var Register_3_ = linkarray[Register_1_].slice(0, linkarray[Register_1_].indexOf("^"));
            var Register_3_ = Register_3_.concat("&");
            var Register_3_ = Register_3_.concat(linkarray[Register_1_].slice((linkarray[Register_1_].indexOf("^") + 1)));
            linkarray[Register_1_] = Register_3_;
        }
        Register_1_++;
    }
}
function replink_deleted(textarray) {
    var Register_2_ = undefined;
    var Register_4_ = undefined;
    var Register_2_ = 0;
    while (Register_2_ < textarray.length) {
        if (textarray[Register_2_].indexOf("<a") == -1) {
            textarray[Register_2_] = ((("<a href=\'" + _root.link_array[Register_2_]) + "\' target=\'_blank\'>") + textarray[Register_2_]) + "</a>";
        }
        Register_2_++;
    }
}
function preloader1(target) {
    mc = target.pic;
    var Register_2_ = int(mc.getBytesLoaded() / mc.getBytesTotal() * 100);
    if (Register_2_ >= 100) {
        delete target.onEnterFrame;
        target._width = borderwidth;
        target._height = borderheight;
    }
}
stop();
_root.sinalogo._visible = false;
pic_array = new Array();
link_array = new Array();
text_array = new Array();
strtoarray(pics, pic_array);
strtoarray(links, link_array);
replinkad(link_array);
if (_root.textheight > 0) {
    strtoarray(texts, text_array);
    replink(text_array);
    _root.text_m._x = -borderwidth / 2;
    _root.text_m._y = borderheight / 2 - textheight / 2;
}
var adPos = -1;
if (pic_array.length > 2) {
    if (pic_array[(pic_array.length - 1)].indexOf("http://ad4") != -1 || pic_array[(pic_array.length - 1)].indexOf(".swf") != -1) {
        adPos = 2;
        var tempContent = pic_array[(pic_array.length - 1)];
        var i = (pic_array.length - 2);
        while (i >= 2) {
            pic_array[(i + 1)] = pic_array[i];
            i--;
        }
        _root.pic_array[2] = tempContent;
        tempContent = link_array[(link_array.length - 1)];
        var i = (link_array.length - 2);
        while (i >= 2) {
            link_array[(i + 1)] = link_array[i];
            i--;
        }
        link_array[2] = tempContent;
        if (_root.textheight > 0) {
            tempContent = text_array[(text_array.length - 1)];
            var i = (text_array.length - 2);
            while (i >= 2) {
                text_array[(i + 1)] = text_array[i];
                i--;
            }
            text_array[2] = tempContent;
        }
    }
}
var swfPos = -1;
var ifSwf = false;
var i = 0;
while (i < pic_array.length) {
    if (pic_array[i].indexOf(".swf") != -1) {
        swfPos = i;
        ifSwf = true;
    }
    i++;
}
Stage.scaleMode = "noScale";
_root.border.swapDepths(10);
_root.border._width = borderwidth - 1;
_root.border._height = borderheight - 1;
_root.border._x = -borderwidth / 2 + 1;
_root.border._y = (-borderheight / 2 - textheight / 2) + 1;
_root.linkbutton1._xscale = Math.ceil(_root.borderwidth * 100 / 400);
_root.linkbutton1._yscale = Math.ceil((_root.borderheight + _root.textheight) * 100 / 300);
_root.linkbutton1._x = -borderwidth / 2 + 1;
_root.linkbutton1._y = (-borderheight / 2 - textheight / 2) + 1;
var current_pic = -1;
if (pic_array.length == 1) {
    m = createEmptyMovieClip("image0", 0);
    m_load = m.createEmptyMovieClip("pic", 0);
    m._x = -borderwidth / 2;
    m._y = -borderheight / 2 - textheight / 2;
    m_load.loadMovie(pic_array[0]);
    m.onEnterFrame = function() {
        preloader1(this);
    };
    current_pic = 0;
} else {
    gotoAndStop("multipic");
    play();
}

以上部分是第一侦里的

下面是第二侦里的
function init_trans() {
    n = 0;
    while (n < _root.trans_total) {
        with (eval(("_root.mask" + n))) {
            _x = -_root.borderwidth / 2;
            _y = -_root.borderheight / 2 - _root.textheight / 2;
        }
        n++;
    }
}
function preloader(target, flagSwfPre) {
    mc = target.pic;
    var Register_3_ = int(mc.getBytesLoaded() / mc.getBytesTotal() * 100);
    if (Register_3_ >= 100) {
        delete target.onEnterFrame;
        setProperty(("_root.buttonbanner.num" + (target.getDepth() + 1)), _alpha, "100");
        if (target == _level0.image0) {
            mc._alpha = 100;
            _root.buttonbanner.num1.gotoAndStop(3);
            _root.current_pic = 0;
            _root.timer.gotoAndPlay(2);
        }
        if (flagSwfPre != 1) {
            target._width = borderwidth;
            target._height = borderheight;
        }
        if (flagSwfPre == 1) {
            mc.stop();
        }
    }
}
function swappic(d1, d2) {
    with (eval(("_root.image" + _root.pre_pic))) {
        swapDepths(6);
    }
    with (eval(("_root.image" + _root.current_pic))) {
        swapDepths(d1);
    }
    with (eval(("_root.image" + _root.pre_pic))) {
        swapDepths(d2);
    }
}
function changepic() {
    if (pic_array.length > 1) {
        i = 0;
        while (i < pic_array.length) {
            setProperty((("_root.image" + i) + ".pic"), _alpha, "0");
            with (eval(("_root.buttonbanner.num" + (i + 1)))) {
                gotoAndStop(1);
            }
            i++;
        }
        _root.mask_total = eval((("_root.mask" + _root.trans_cur) + ".mask_total"));
        if (_root.mask_total > -1) {
            j = 0;
            while (j <= _root.mask_total) {
                removeMovieClip(((("_root.mask" + _root.trans_cur) + ".block") + j));
                j++;
            }
        }
        with (eval((("_root.image" + _root.pre_pic) + ".pic"))) {
            setMask(null);
        }
        if (_root.ifSwf && _root.pre_pic == _root.swfPos) {
            with (eval((("_root.image" + _root.swfPos) + ".pic"))) {
                gotoAndStop(1);
            }
            _root.intervaltotaltime = _root.intervaltotaltimeSave;
        }
        _root.trans_cur = random(_root.trans_total);
        with (eval((("_root.image" + _root.current_pic) + ".pic"))) {
            setMask(("mask" + _root.trans_cur));
        }
        _root.masking = true;
        with (eval(("_root.mask" + _root.trans_cur))) {
            play();
        }
        setProperty((("_root.image" + _root.current_pic) + ".pic"), _alpha, "100");
        setProperty((("_root.image" + _root.pre_pic) + ".pic"), _alpha, "100");
        if (_root.pre_pic > _root.current_pic) {
            _root.ifswaped = true;
            _root.swappic(_root.pre_pic, _root.current_pic);
        }
        with (eval(("_root.buttonbanner.num" + (_root.current_pic + 1)))) {
            gotoAndStop(3);
        }
        if (_root.textheight > 0) {
            with (_root.text_m.titletext) {
                htmltext = ("<b>" + _root.text_array[_root.current_pic]) + "</b>";
            }
        }
    }
}
function gotolink() {
    if (_root.pre_pic == -1) {
        getURL(link_array[0], "_blank");
    } else {
        getURL(link_array[_root.pre_pic], "_blank");
    }
}
function gotolink_mask() {
    getURL(link_array[_root.current_pic], "_blank");
}
function playandswitch(pic) {
    if (!_root.masking) {
        _root.timer.gotoAndStop(1);
        _root.pre_pic = _root.current_pic;
        _root.current_pic = pic;
        _root.changepic();
    } else {
        _root.next_pic = pic;
    }
}
function draw_mask(mask, a, b, c, d) {
    mask.clear();
    mask.lineStyle(0, 0);
    mask.moveTo(a, b);
    mask.beginFill(0);
    mask.lineTo(a, d);
    mask.lineTo(c, d);
    mask.lineTo(c, b);
    mask.lineTo(a, b);
    mask.endFill();
}
stop();
_root.attachMovie("pointerchanger", "pointer_btn", 50000);
_root.pointer_btn._alpha = 0;
_root.pointer_btn._x = -borderwidth / 2;
_root.pointer_btn._y = borderheight / 2 - _root.textheight / 2;
_root.pointer_btn._height = _root.textheight;
_root.pointer_btn._width = borderwidth;
var pre_pic = -1;
var current_pic = -1;
var next_pic = -1;
var intervaltotaltime = 5;
var intervalsecond = 0;
var mask_total = -1;
var mask_num = 0;
var trans_total = 21;
var trans_cur = 20;
var ifswaped = false;
var masking = false;
var intervaltotaltimeSwf = 6;
var intervaltotaltimeSave = 0;
_root.linkbutton._xscale = Math.ceil(_root.borderwidth * 100 / 400);
_root.linkbutton._yscale = Math.ceil(_root.borderheight * 300 / 600);
_root.linkbutton._x = -_root.borderwidth / 2;
_root.linkbutton._y = -_root.borderheight / 2 - _root.textheight / 2;
init_trans();
var i = 0;
b = createEmptyMovieClip("buttonbanner", 8);
b_banner_back = b.attachMovie("banner_back", "banner_back", 0);
b_banner_back._x = _root.borderwidth / 2 - b_banner_back._width;
b_banner_back._y = (_root.borderheight / 2 - _root.textheight / 2) - 13;
onEnterFrame = function () { if (i < _root.pic_array.length){ m = createEmptyMovieClip(("image" + i), i); m_load = m.createEmptyMovieClip("pic", 0); b_num = b.attachMovie(("button" + (i + 1)), ("num" + (i + 1)), (i + 2)); b_num._alpha = 0; b_num._x = Math.ceil(((_root.borderwidth / 2 - (_root.pic_array.length - i) * 23) + 7)); b_num._y = Math.ceil(((_root.borderheight / 2 - _root.textheight / 2) - 10)); m._x = -_root.borderwidth / 2; m._y = -_root.borderheight / 2 - _root.textheight / 2; m_load.loadMovie(pic_array[i]); m_load._alpha = 0; var flagSwf; if (_root.ifSwf && i == _root.swfPos){ flagSwf = 1; } else { flagSwf = 0; } m.onEnterFrame = function () { preloader(this, flagSwf); }; } else { delete i; delete onEnterFrame; _root.loader._alpha = 0; } i++; };



captainrays

职务:版主
等级:1
金币:3.0
发贴:48
注册:2005/3/12 23:49:48
#22006/9/14 14:59:07
function replink_deleted(textarray) {
var Register_2_ = undefined;
var Register_4_ = undefined;
var Register_2_ = 0;
while (Register_2_ < textarray.length) {
if (textarray[Register_2_].indexOf("<a" == -1) {
textarray[Register_2_] = ((("<a href=\'" + _root.link_array[Register_2_]) + "\' target=\'_blank\'>" + textarray[Register_2_]) + "</a>"; }
Register_2_++;
}
}

没细看,这一行吧应该是,可以把<a>里面修改一下样式。
另外你看changepic的后面
if (_root.textheight > 0) {
with (_root.text_m.titletext) {
htmltext = ("<b>" + _root.text_array[_root.current_pic]) + "</b>";
}
}
你把那个_root.text_m.titletext设成多行,那是他自己create的。

这玩意儿写得虽然不规范,还挺复杂。。强人多啊。。。唉