View Full Version : Drawing function
wenbri
05-26-2001, 11:34 PM
Trying to learn how to make a simple drawing function based on mouse position.
Jesse
05-27-2001, 03:21 AM
http://www.actionscripts.org/tutorials/intermediate/Draw_a_line/index.shtml
?
Cheers
Jesse
wenbri
06-16-2001, 06:55 PM
Not really what I had in mind. I want to begin drawing when the mouse is pressed and stop when released.
Jesse
06-17-2001, 02:54 PM
Create a small dot (I used the paint brush tool) and make it an MC with an instance name of 'dot'. Then create a controller MC and add these actions:
onClipEvent (load) {
count = 0;
}
onClipEvent (mouseDown) {
draw = true;
}
onClipEvent (mouseUp) {
draw = false;
}
onClipEvent (mouseMove) {
if (draw) {
count ++;
_root.dot.duplicateMovieClip( "dot"+count, count )
with (_root["dot"+count]) {
_x = _root._xmouse;
_y = _root._ymouse;
}
}
}
You may have to increase your frame rate to about 20 fps to get a nice smooth drawing effect.
Don't say I never do anything for you :)
keywords: user draw pad pencil hold mouse paint image picture
peter
06-20-2001, 02:55 PM
check this flashdrawing app.
http://www.ultimatearcade.com/ua/members/1/
then game vault
then game tutorials
then choose advanced
download available
Ok now, now I got a question. I altered a draw app. for on line use. It's got a print function (printasbitmap). But what I want is that people can make drawings online and then send the drawing as a bitmap attachment to my email box.
I haven't got the slightest idea how to do this.(Is it possible at all)
grt peter
Jesse
06-21-2001, 04:01 AM
no you can't output files and send them by email. the best you could do is somehow record the beginning and end points of the lines and store them on the server, then reconstruct the graphic when the user comes back but that's getting really c omplicated :) checkout the E-Cards tutorial which is the closest thing I can think of.
TwoManStudios
10-29-2006, 08:17 PM
This is possible, very possible. But it is going to be difficult.
Create a socket server in java/c++, and then you can use the XMLSocket class to connect to it. Sending the socket server information about the image will allow it to reconstruct a bmp, and then connect to an outgoing mail server and create the email message with the attached file.
Contact me twomanstudios@hotmail.co.uk if you need help.
farafiro
10-31-2006, 04:05 AM
lol
TwoManStudios
yup, now it's too easy to be achieved but this post is 5 years old
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.