Evo moj skromni doprinos za Leo Burnett ... to je cisto crtanje u AS 3.0, i kada strelica misa napusti stage dobijamo fade out efekat.
var myPaper:Sprite = new Sprite();
stage.addChild(myPaper);
function init():void {
myPaper.graphics.lineStyle(1, 0x000000, .3);
myPaper.graphics.moveTo(mouseX, mouseY);
}
init();
stage.addEventListener(MouseEvent.MOUSE_MOVE, continueDrawing);
stage.addEventListener(Event.MOUSE_LEAVE, stopDrawing);
function continueDrawing(e:Event):void {
myPaper.graphics.lineTo(mouseX, mouseY);
}
function stopDrawing(e:Event):void {
myPaper.addEventListener(Event.ENTER_FRAME, fadeOut);
}
function fadeOut(e:Event):void {
e.target.alpha -= .05;
if (e.target.alpha <= .05) {
e.target.alpha = 1;
e.target.graphics.clear();
e.target.removeEventListener(Event.ENTER_FRAME, fadeOut);
init();
}
}
isto to je uradjeno za AS 2.0 (by Tamtitam), ispod je i FLA za AS 3.0
mycity.rs/must-login.png
|