scooba
%Europe/Berlin %526 %2007, 13:37
Hallo allemaal, ik wil de illusie wekken dat iemand kan 'gummen' op een site door de bezoeker met de muis te laten tekenen en deze tekening de onderliggende movieclip te laten masken.
Dit is mijn code tot nu toe:
Erasing = createEmptyMovieClip('Erasing', 1);
theGum = new Object();
theGum.onMouseDown = function() {
isErasing = true;
Erasing.moveTo(_xmouse,_ymouse);
Erasing.lineTo(_xmouse,_ymouse);
};
theGum.onMouseMove = function() {
if (isErasing) {
Erasing.lineTo(_xmouse,_ymouse);
}
};
theGum.onMouseUp = function() {
isErasing = false;
};
Mouse.addListener(theGum);
Erasing.onEnterFrame = function() {
Width = 10;
Erasing.lineStyle(Width,0xFF0000,100);
};
mcSquare.setMask(Erasing);
Je zou denken dat de setMask(Erasing) de truc zou doen, maar dit werkt dus niet.
Iemand een oplossing?
Dit is mijn code tot nu toe:
Erasing = createEmptyMovieClip('Erasing', 1);
theGum = new Object();
theGum.onMouseDown = function() {
isErasing = true;
Erasing.moveTo(_xmouse,_ymouse);
Erasing.lineTo(_xmouse,_ymouse);
};
theGum.onMouseMove = function() {
if (isErasing) {
Erasing.lineTo(_xmouse,_ymouse);
}
};
theGum.onMouseUp = function() {
isErasing = false;
};
Mouse.addListener(theGum);
Erasing.onEnterFrame = function() {
Width = 10;
Erasing.lineStyle(Width,0xFF0000,100);
};
mcSquare.setMask(Erasing);
Je zou denken dat de setMask(Erasing) de truc zou doen, maar dit werkt dus niet.
Iemand een oplossing?