-
This is a generic bit of code that is from a mouse tutorial I wrote for VC++. With some changes, it now works in Flash MX.
Just add this code to the first keyframe on your main movie timeline and set your movie background to be black.
Code:
_root.onMouseDown = function()
{
_root.draw = 1;
newX = _root._xmouse;
newY = _root._ymouse;
moveTo(newX, newY);
}
_root.onMouseUp = function()
{
_root.draw = 0;
}
_root.onMouseMove = function()
{
if (draw)
{
oldX = newX;
newX = _root._xmouse;
oldY = newY;
newY = _root._ymouse;
lineStyle(8, 0xFFFFFF);
lineTo(newX, newY);
}
updateAfterEvent();
};
Let me know if you think it's neat or not, I like it. Just run it, then click and drag your mouse around the screen.
Spyder
Here's a link to a finished version of it:
http://perfectweb.org/chalkboard.html
[Edited by NetSpyder101 on 03-16-2002 at 09:41 AM]
-
very nice i like it a lot.
thanx for sharing.
Pet
-
Moderator
-
Ok -- just because I was bored at work before leaving:
I've added in a small color palette and a size adjuster for painting. I'm happy to give the .fla to anyone who wants it.
Spyder
http://perfectweb.org/chalkboard.html
-
When you use the lineto function (whether you are using a fill, a gradient fill, or no fill at all), it doesn't take long for flash to hog up a lot of memory (we all remember the problems with drawing too many detailed graphics onto the screen with a slow system in Flash 5).
Just keep that in mind when you are using the lineto function to have it automatically draw animation. the clear() function wipes out all previous drawings to the screen, allowing you to free memory and start fresh.
Spyder
-
Very nice! Will you send me the .fla? My email address is binaryboy@popmail.com.
-
-
If you want the .fla --
http://perfectweb.org/drawing.fla
enjoy
Spyder
-
Very cool!
It would be neat if you could 1) export it as a jpeg, and 2) send it in email!
-
Moderator
Re: Very cool!
Why send a non active jpeg ?
Send the .swf baby !!
-
Re: Re: Very cool!
Originally posted by estudioworks
Why send a non active jpeg ?
Send the .swf baby !!
Sure you could. I was just thinking of it as a simple tool for sketching and sharing ideas. As a jpeg it could easily be viewed in the contents of email. (Hmmmm...can an swf be viewed in email? I've never had any luck with it.)
-
Senior Member
Very coooooooooooool
thanks NetSpyder101,
I only got flash MX yesterday and that will
probably be the best thing i have seen for ages.
-
Moderator
Re: Re: Re: Very cool!
Yes it can !!
And the jpeg would me static !!
-
Re: Re: Re: Re: Very cool!
Originally posted by estudioworks
Yes it can !!
And the jpeg would me static !!
Me so sorry. I think I didn't make myself clear. I was thinking that one could use the tool to draw something and then export the resulting drawing and send it to interested parties.
-
Moderator
Re: Re: Re: Re: Re: Very cool!
Oh, I gotcha !!
-
An extension of...
First off: Great idea/use of new features of Flash MX
However, I tried to extend it, to test weather it could be used with maskes, that it is, I changed the code by removing the _roots from the the draw flag, and put it inside a clip, that acted as a mask. The second I tried this, flash promtly crashed, I have tried this the other way round(ie: with set make, but dynamic masked content), but it still didn't work. Has anyone got any solution to this problem?
Finally, is that VC tutorial online, because I would definatly like to read it.
Thx again for the interesting code which will undoubtedly be reused many times.
[Edited by Ba'alzamon on 03-19-2002 at 03:25 AM]
-
Nice bro...my kids will dig playing with it!! Oldest is 7...trying to get her in to Flash! ha! kidding...well not really.
- Sigma
-
Originally posted by Sigma
Nice bro...my kids will dig playing with it!! Oldest is 7...trying to get her in to Flash! ha! kidding...well not really.
- Sigma
Where you been? - kids have been into flash for years:
http://www.tygh.co.uk
-
the jpeg idea sounds dope.... someone get onto it
-
I took my VC tutorial site offline when I didn't have time to support it anymore. I can try to scrounge up an older copy of that tutorial if you'd like.
As for exporting it as a jpeg...I personally would have no idea how to do it from flash, I can set it up so you can print it out all nice and pretty but that's the extent of the image handling I could do with it. Sorry
Working on some new tools to allow you to draw polygons, circles, and squares as well (make it into a full paint program).
Cheers,
spyder
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|