Drawing simulation

I`m workin on a cd-rom project about art analysis, paintings, artists, bla bla.
It is for a teacher that will use it in his classes.
[color=red]I need to learn how to simulate a blackboard, that he could click and paint on some parts of the paintings.[/color]
Does anyone know a tutorial about that?

:thumb:

You mean like this

http://www.kirupa.com/developer/actionscript/drawingboard.htm

??

:-\

or this…?

http://www.umbc.edu/interactive/fla/colorme.swf
http://www.umbc.edu/interactive/fla/colorme.fla

^^ senocular’s… :slight_smile:

perfect! :slight_smile:
I didnt look for it at Kirupa!
Thanks

*Originally posted by Felipe Bastos *
**perfect! :slight_smile:
I didnt look for it at Kirupa!
Thanks **

:!: :!: :!:

You didn’t look for it at Kirupa!!!

:!: :!: :!:

[size=1]::stares gazingly down at my footer[/size]

:stuck_out_tongue: hehehe

Thanks also to ahmed!
This will be also usefull!
:):):slight_smile:

How can I set limits?
top 20
bottom 400
left 0
right 420

here’s how i did a while back:


	this.onEnterFrame = function() {
		if (_xmouse>271) {
			lineTo(271, _ymouse);
		} else if (_xmouse<30) {
			lineTo(30, _ymouse);
		} else if (_ymouse<45) {
			lineTo(_xmouse, 45);
		} else if (_ymouse>225) {
			lineTo(_xmouse, 225);
		} else {
			lineTo(_xmouse, _ymouse);
		}

	};

:slight_smile:
there might be a better way though… im not really sure

You are pretty fast!
zooooooooooooooooooooom
Thanks :thumb:

:wink:

You could also try setMask if you wanted to…

Add this after _root.createEmptyMovieClip(“line”, 1);

[AS]_root.createEmptyMovieClip(“mask”, 2);
mask.beginFill(0x000000, 100);
mask.moveTo(20, 0);
mask.lineTo(20, 420);
mask.lineTo(400, 420);
mask.lineTo(400, 0);
line.setMask(mask);[/AS]

I didn’t test it, but yeah…lol.

Hey ahmed!
Would u mind sharing your knowlogy and tell me how to use cookies like u do with … your thing to draw, I forgot the name of this thing!??
:slight_smile:

hey lost, i think you’re way’s way better (doesn’t have to go through 4 if’s) … :slight_smile:

and… here’s a tutorial on shared objects: flash mx cookies :slight_smile:

Thanks again ahmed
My boss will love this!

ahmed: I honestly don’t know which method is better, yours has to go through 4 if statements, but mine still draws content outside of the border, which still uses up resources.

So hmmm.

The mask did not work!
:frowning:

*Originally posted by lostinbeta *
**ahmed: I honestly don’t know which method is better, yours has to go through 4 if statements, but mine still draws content outside of the border, which still uses up resources.

So hmmm. **

hmmmm…

*Originally posted by Felipe Bastos *
**The mask did not work!
:frowning: **
it does work, but you will have to draw within a movieclip called ‘line’

createEmptyMovieClip("line", ++depth)
createEmptyMovieClip("mask", ++depth)
mask.beginFill(0x000000, 100);
mask.moveTo(20, 0);
mask.lineTo(20, 420);
mask.lineTo(400, 420);
mask.lineTo(400, 0);
line.setMask(mask);
line.lineStyle(0)
line.onMouseDown = function() {
this.moveTo(_xmouse, _ymouse)
this.onEnterFrame = function() {
this.lineTo(_xmouse, _ymouse)
}
}
line.onMouseUp = function() {
delete this.onEnterFrame
}

or something like that :slight_smile:

A black background is created and it does not work as a mask!

It worked for me…

I did this…

[AS]// 1. SETTING THINGS
_root.createEmptyMovieClip(“line”,1);
_root.createEmptyMovieClip(“mask”, 2);
mask.beginFill(0x000000, 100);
mask.moveTo(20, 0);
mask.lineTo(20, 420);
mask.lineTo(400, 420);
mask.lineTo(400, 0);
line.setMask(mask);
// 2. EVENTS IN _ROOT:
_root.onMouseDown = function(){
line.moveTo(_xmouse,_ymouse);
line.lineStyle(2,0x000000,100);
this.onMouseMove = function(){
line.lineTo(_xmouse,_ymouse);
updateAfterEvent();
}
}
_root.onMouseUp = function(){
this.onMouseMove = null;
}[/AS]

ahmeds method created 2 clips on the same level, you can’t do that, the new one overwrites the old one.

im sure it works, just tried it :slight_smile:

http://24.141.60.208/draw_thingie.fla