0

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.

PATH TO THE FLA FILE: http://ykt.wen.RU/ticker.rar

1.can someone help me and do it for me here?

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?

or

  1. can some one upload another .fla file with what I need for me?

THANKS

1 Answers1

0

You just have to insert your two textfields into an emptyMovieClip (Box), and mask it by using the setMask property. You need to put a movieClip named myMask on your scene.

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:

this.setMask(myMask);
helloflash
  • 2,457
  • 2
  • 15
  • 19
  • thank you all 2 ways are working fine, masking the text as i need, but a problem with the first solution is the scrolling text refuse to scroll after masking, please can you help and fix it? – user3351542 Jan 08 '15 at 07:25
  • @user3351542 If I copy / paste this code instead of yours in your .fla, it works. – helloflash Jan 08 '15 at 07:32
  • it works bro pls can you help me again and tell me what to change to make the loop of the scrolling text unlimited? so that it will never stop (and it will contineously repeat), because now it stop at 16 loops only – user3351542 Jan 08 '15 at 10:52