all groups > flash actionscript > july 2007 >
You're in the

flash actionscript

group:

paint effect


Re: paint effect Patrick B
7/19/2007 6:31:19 PM
flash actionscript:
This is actually fairly simple. Not sure what exactly you want but this
should be a good start:

var
drawClip=_root.createEmptyMovieClip('_drawing',_root.getNextHighestDepth());
drawClip.lineStyle(1,0xFFFF00,100);
drawClip.moveTo(_xmouse,_ymouse);
Mouse.addListener(this);
function onMouseMove() {
_root._drawing.lineTo(_xmouse,_ymouse);
}

The line is yellow so you may want to use a dark background colour. If
you like this, drop by my site and get involved in my forums (link
below). Lots more good stuff to come there ;)

Regards,
Patrick

--
http://www.baynewmedia.com
Faster, easier, better...ActionScript development taken to new heights.
Download the BNMAPI today. You'll wonder how you ever did without it!
Available for ActionScript 2.0/3.0.


[quoted text, click to view]

paint effect skywalker27
7/19/2007 10:18:47 PM
Re: paint effect skywalker27
7/20/2007 1:13:50 AM
Re: paint effect Patrick B
7/20/2007 1:27:40 AM
Hi again,

You'll probably need to tweak this a bit but it should be close to what
you need without much overhead:

var
drawClip=_root.createEmptyMovieClip('_drawing',_root.getNextHighestDepth());
var colours = [0x000000, 0xFFFFFF];
var alphas = [100,0];
var ratios = [0,255];
var matrix = {a:5, b:0, c:1, d:0, e:10, f:1, g:1, h:1, i:1};
var spreadMethod = "reflect";
var interpolationMethod = "rgb";
var focalPointRatio =0;
drawClip.lineStyle(2,0x0000FF,100);
drawClip.lineGradientStyle("linear", colours , alphas, ratios, matrix,
spreadMethod, interpolationMethod, focalPointRatio);
drawClip.moveTo(_xmouse,_ymouse);
Mouse.addListener(this);
function onMouseMove() {
_root._drawing.lineTo(_xmouse,_ymouse);
}

Fiddle with the matrix and focalPointRatio values to begin with. To use
different colours, you need to change the colours array. The first valus
is the actual dash, the second item is what it fades to. If you change
the alphas, you can create a dash that fades between two colours. You
can get fancier by adding more values too :)

Good luck,
Patrick

--
http://www.baynewmedia.com
Faster, easier, better...ActionScript development taken to new heights.
Download the BNMAPI today. You'll wonder how you ever did without it!
Available for ActionScript 2.0/3.0.

[quoted text, click to view]

AddThis Social Bookmark Button