I have a movieclip in the library with linkage "dot". I would like to make a drawing tool out of this movie clip. Could anyone provide me with a code to make the dot spawn at the mouse point when you click? :)
Printable View
I have a movieclip in the library with linkage "dot". I would like to make a drawing tool out of this movie clip. Could anyone provide me with a code to make the dot spawn at the mouse point when you click? :)
Use a mouse listener. Every frame, check the listener. If it's true (mouse is down) then use attachMovie("dot", mcName, depth) and apply mouseX mouseY to your new clip.
thanx, ill see how it works :)
Since I came here from the virus thread, I assume you're considering to use the drawing API as well.
Basically it works like the attaching of the dot movieclip:
1. write something that triggers the current mouse position (either using an onMouse move event or an onEnterFrame)
2. onMousedown set the starting point of the paint process via "moveTo" of the drawing API (be sure to set the linestyle first)
3. while the mouse is down, "lineTo" to the current mouse position.
4. stop drawing when the mouse isn't pressed anymore.
I guess I be able to upload a small demo fla in a few minutes ...
nGFX
yea, i just wonderd if you could use a code similar to the API version. It doesnt matter now anyway, because i have created the effect i wanted in API. Thanx for all help. :)