A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [F8] non API drawing tool

  1. #1
    purple lizard
    Join Date
    Jan 2007
    Location
    somewhere in the world
    Posts
    85

    [F8] non API drawing tool

    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?

  2. #2
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,379
    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.
    The 'Boose':
    ASUS Sabertooth P67 TUF
    Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
    8GB G.Skill Ripjaws 1600 DDR3
    ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
    New addition: OCZ Vertex 240GB SATA III SSD
    WEI Score: 7.6

  3. #3
    purple lizard
    Join Date
    Jan 2007
    Location
    somewhere in the world
    Posts
    85
    thanx, ill see how it works

  4. #4
    383,890,620 polygons nGFX's Avatar
    Join Date
    Oct 2002
    Location
    Germany / Ruhrgebiet
    Posts
    902
    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

  5. #5
    purple lizard
    Join Date
    Jan 2007
    Location
    somewhere in the world
    Posts
    85
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center