codice:
// funzione per far scorrere il testo
function scorriTesto() {
this.testo._x -= this.velScorri;
if (Math.abs(this.testo._x)>this.testo._width-this._parent.maskera._x) {
this.testo._x = this._parent.maskera._x+this._parent.maskera._width;
}
}
// funzione per creare il campo di testo e maschera
function creaScroller() {
this.createEmptyMovieClip("mcTesto", 1);
mcTesto.createTextField("testo", 1, 0, 0, 1, 1);
this.createEmptyMovieClip("maskera", 2);
// preparo la maschera
with (maskera) {
larghezza = 400;
altezza = 20;
// creazione della maschera \\
beginFill(0xffffff, 100);
lineStyle(0, 0x000000, 100);
moveTo(0, 0);
lineTo(larghezza, 0);
lineTo(larghezza, altezza);
lineTo(0, altezza);
lineTo(0, 0);
endFill();
// fine creazione \\
}
mcTesto.setMask(maskera);
// posiziono la maschera \\
maskera._x = 0;
// valore a piacere
maskera._y = 0;
// valore a piacere
// FORMATTAZIONE DEL CAMPO DI TESTO
formatoTesto = new TextFormat();
formatoTesto.size = "10";
formatoTesto.font = "char";
// carattere esportato dalla libreria
with (mcTesto) {
// posiziono il campo di testo
testo._y = maskera._y;
// coordinata y uguale a quella della maschera;
testo._x = maskera._x+maskera._width;
// coorindata x in modo che il testo si trovi all'inizio della maschera
testo.html = true;
testo.htmlText = iltesto;
testo.textColor = 0x009999;
testo.autoSize = true;
testo.selectable = false;
}
mcTesto.testo.embedFonts = true;
// incorporo i caratteri nel campo di testo creato
mcTesto.testo.setTextFormat(formatoTesto);
// applico le modifiche al campo di testo
mcTesto.velScorri = 2;
// velocità
mcTesto.onEnterFrame = scorriTesto; //richiamo la funzione per scorrere il testo
}
l'hai messo nel posto giusto?