1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| monTexte = "<p>Lorem ipsum<p>";
vxmin = 3;
vxmax = 8;
vx = 0.5*(vxmin+vxmax);
monStyle = new TextField.StyleSheet();
monStyle.setStyle("p", {fontFamily:'Arial', fontSize:'25px', color:'#ffffff'});
this.createEmptyMovieClip("monClip", 0);
monClip.cacheAsBitmap = true;
monClip.createTextField("monChampDeTexte", 0, 0, 0, 0, 0);
with (monClip.monChampDeTexte) {
autoSize = true;
html = true;
styleSheet = monStyle;
htmlText = monTexte;
selectable = false;
border = false;
largeur = _width;
hauteur = _height;
}
xRight = 280;
xLeft = 10;
this.createEmptyMovieClip("masque", 1);
masque._x = monClip._x=xLeft;
masque._y = monClip._y=0;
masque.beginFill(0, 100);
masque.moveTo(0, 0);
masque.lineTo(xRight-xLeft, 0);
masque.lineTo(xRight-xLeft, hauteur);
masque.lineTo(0, hauteur);
masque.lineTo(0, 0);
masque.endFill();
blurX = 30;
filtre = new flash.filters.BlurFilter(blurX, 0, 1);
masque.filters = [filtre];
monClip.setMask(masque);
monClip.onEnterFrame = function() {
var dy = Math.abs(this._ymouse-0.5*hauteur);
if (dy>0.5*hauteur) {vx = vxmin+(vxmax-vxmin)*dy/Stage.height;} else {vx = vxmin;}
this._x -= vx;
if (this._x<xLeft-largeur) {this._x = xRight;}
}; |
Partager