简体   繁体   English

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

[英]Mask Externally loaded html text in flash

since 3 days back I have been trying to mask this externally loaded HTML text but no success, what I want is to show the scrolling text only in a square or an oval shape, but not in the whole layer width. 自3天前以来,我一直试图掩盖此外部加载的HTML文本,但没有成功,我想要的是仅以正方形或椭圆形而不是整个图层宽度显示滚动文本。

PATH TO THE FLA FILE: http://ykt.wen.RU/ticker.rar FLA文件的路径:http: //ykt.wen.RU/ticker.rar

1.can someone help me and do it for me here? 1.有人可以帮我在这里帮我吗?

or 要么

  1. (MOST WANTED) can some one show me how to control the starting and ending point of the scrolling text using the as2 code? (最想要的)可以有人告诉我如何使用as2代码控制滚动文本的起点和终点吗?

or 要么

  1. can some one upload another .fla file with what I need for me? 有人可以上传另一个我需要的.fla文件吗?

THANKS 谢谢

You just have to insert your two textfields into an emptyMovieClip (Box), and mask it by using the setMask property. 您只需要将两个文本字段插入emptyMovieClip(框)中,并使用setMask属性对其进行遮罩即可。 You need to put a movieClip named myMask on your scene. 您需要在场景上放置一个名为myMask的movieClip。

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);

Other solution 其他解决方案

More simple, you can directly mask your _root (as a container), just adding before your code: 更简单地说,您可以直接屏蔽_root (作为容器),只需在代码之前添加:

this.setMask(myMask);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM