Ciao a tutti,
Sto usando questo codice per disegnare su stage:
Vorrei però poter disegnare su maschera, ottenendo l'effetto gratta e vinci, quindi invece di disegnare su sfondo vorrei usare il mouse per "cancellare" lo sfondo e mostrare ciò che c'è sotto.codice:MouseMov = new Array(); this.isDrawing = false; this.createEmptyMovieClip("disegno", this.getNextHighestDepth()); // var tracciaMouse:Object = new Object(); // tracciaMouse.onMouseDown = function () { if (!this.isDrawing) { this.isDrawing = true; //this.createEmptyMovieClip("disegno", this.getNextHighestDepth()); disegno.lineStyle(15, 0x000000, 100); disegno.moveTo(_xmouse, _ymouse); MouseMov.push({thex:_root._xmouse, they:_root._ymouse}); } }; // tracciaMouse.onMouseMove = function() { if (this.isDrawing) { disegno.lineTo(_xmouse, _ymouse); MouseMov.push({thex:_root._xmouse, they:_root._ymouse}); } updateAfterEvent(); }; // tracciaMouse.onMouseUp = function () { this.isDrawing = false; for (i = 0; i < MouseMov.length; i++) { trace ("xyelem. "+i+": "+MouseMov[i].thex+" / "+MouseMov[i].they); } };
Sapete come si può fare partendo da questo script, o c'è bisogno di tutt'altro?
Grazie mille ragazzi

Rispondi quotando