impsvi
11-27-2005, 04:31 PM
hello, ive got stuck trying to do somthing pretty simple.
Using drawing api i have used the following code (below) to allow the user to draw.
The code creates an empty movie clip so the drawing api can work, but this allows the user to draw over everything on screen.
I tried to make it so the code refrenced a movie clip i had on stage instead of creating a empty one, but this did not work. I also tried applying the code inside a movieclip which i placed on stage but this also failed.
Im trying to make it so there is a drawing box on screen (movieclip) and outside of that box the user cannot draw.
How would i edit this code so it works only on a movieclip placed on the stage?
*************************************
_root.createEmptyMovieClip("paintClip", 1);
var thickness:Number = 1;
var colour:Number = 0x000000;
var alpha:Number = 100;
onMouseDown = function () {
paintClip.moveTo(_xmouse, _ymouse);
onMouseMove = function () {
paintClip.lineStyle(thickness, colour, alpha);
paintClip.lineTo(_xmouse, _ymouse);
};
};
onMouseUp = function () {
onMouseMove = null;
};
*************************************
Im using flash8 as2 and the .fla is included.
Thanks,
Vic
Using drawing api i have used the following code (below) to allow the user to draw.
The code creates an empty movie clip so the drawing api can work, but this allows the user to draw over everything on screen.
I tried to make it so the code refrenced a movie clip i had on stage instead of creating a empty one, but this did not work. I also tried applying the code inside a movieclip which i placed on stage but this also failed.
Im trying to make it so there is a drawing box on screen (movieclip) and outside of that box the user cannot draw.
How would i edit this code so it works only on a movieclip placed on the stage?
*************************************
_root.createEmptyMovieClip("paintClip", 1);
var thickness:Number = 1;
var colour:Number = 0x000000;
var alpha:Number = 100;
onMouseDown = function () {
paintClip.moveTo(_xmouse, _ymouse);
onMouseMove = function () {
paintClip.lineStyle(thickness, colour, alpha);
paintClip.lineTo(_xmouse, _ymouse);
};
};
onMouseUp = function () {
onMouseMove = null;
};
*************************************
Im using flash8 as2 and the .fla is included.
Thanks,
Vic