屏蔽 Flash 中外部加载的 html 文本



自 3 天前以来,我一直在尝试屏蔽这个外部加载的 HTML 文本但没有成功,我想要的是仅以正方形或椭圆形显示滚动文本,而不是整个图层宽度。

FLA 文件的路径:http://ykt.wen.RU/ticker.rar

1.有人可以帮助我,在这里为我做吗?

  1. (最想要的)有人可以告诉我如何使用as2代码控制滚动文本的起点和终点吗?

  1. 有人可以上传另一个.fla文件,其中包含我需要的文件吗?

谢谢

只需将两个文本字段插入到空的影片剪辑 (Box) 中,并使用 setMask 属性对其进行屏蔽。您需要在场景中放置一个名为 myMask 的影片剪辑。

var Box = this.createEmptyMovieClip("Box", this.getNextHighestDepth());
Box.setMask(myMask);
System.useCodepage = true;
function newsticker(inhalt, posX, posY, tiefe, tempo) {
    this.loadVariables(inhalt);
    this.onData = function() {
        Box.createTextField("text", tiefe, posX, posY, 10, 20);
        Box.createTextField("text2", tiefe + 1, posX, posY, 10, 20);
        with(Box) {
        text.html = true;
        text.htmlText = news;
        text.selectable = false;
        text.autoSize = "left";
        text2.html = true;
        text2.htmlText = news;
        text2.selectable = false;
        text2.autoSize = "left";
        text2._x = text._width;
        }
        function tick() {
            with(Box) {
                text._x -= tempo;
                text2._x -= tempo;
                if (text._x >= posX) {
                    text._x = posX;
                    text2._x = text._width + posX;
                }
            }
            updateAfterEvent();
        }
        ykt1_btn.onRollOver = function() {
            clearInterval(tick_interval);
        }
        ykt1_btn.onRollOut = function() {
            tick_interval = setInterval(tick, 30);
        }
        if (!tick_interval) {
            tick_interval = setInterval(tick, 30);
        }
    }
}
newsticker("ticker.txt", 0, 7, 1, 1);

其他解决方案

更简单的是,您可以直接屏蔽_root(作为容器),只需在代码之前添加:

this.setMask(myMask);

最新更新