Learn to draw with the mouse on Html 5 canvas inside the browser (using createJs).

Hello world
In Flash AS2/3, we can draw with the mouse in the browser (of course within the Flash Player). How can we do that in DC Flash Canvas using CreateJs (the result should be in canvas not in flash player). Something like this http://www.codicode.com/art/how_to_draw_on_a_html5_canvas_with_a_mouse.aspx
Thanks in advance

Here's the code if anyone is interested.

form of var oldX, oldY, size, color;

form is new createjs. Shape();

stage.on ("stagemousemove", function (evt) {}

If {(oldX)

shape.graphics.beginStroke (color)

.setStrokeStyle (size, "round")

.moveTo (oldX, oldY)

.lineTo (evt.stageX, evt.stageY);

internship. Update();

}

oldX = evt.stageX;

oldY = evt.stageY;

internship. Update();

})

stage.on ("stagemouseup", function (event) {}

color = createjs. Graphics.getRGB (50, 100, 150, 1);

});

stage.on ("stagemousedown", function (event) {}

color = createjs. Graphics.getRGB (50, 100, 150, 1);

size = 4;

});

stage.on ("stagemouseup", function (event) {}

Color = "";

});

stage.addChild (shape);

internship. Update();

Tags: Adobe Animate

Similar Questions

  • The difficulty of drawing with the pencil while zoomed in?

    When I draw on the stage using the pencil tool, while zooming in, the line I draw looks huge when I click and drag. When I let go, the line matches the size of other lines that I paint.

    Therefore, it is difficult to draw with any degree of detail when I zoomed in. Is it possible to change the 'preview' of the line that I paint everything by dragging?

    Here are some images showing what I mean:

    http://I39.Tinypic.com/2vjo6s7.PNG

    http://i43.Tinypic.com/mj0aid.PNG

    Also, I don't like the fact that the lines appear pixelated/pellet when I paint them, and then they become smooth, when I finished draw them. I would like if they would smooth look while I'm trying to actually draw them. Is it possible to change this?

    Thank you!

    [display left forum general forum by moderator - not a discussion AS3 AS3]

    [it's not clear it's a matter of flash pro cc, be - mod kglad]

    This behavior has been changed in Flash CC. Now when you draw with the pencil, even in maximized mode, live preview appears as the proper thickness (as if the drawing scale mode).

  • SWF files that can evolve with the browser

    I downloaded a file with dreamweaver as a stand-alone window swf and it works fine.  How can I get the SWF to a scale large or small that the user must adapt to their browser window, large and small?  I would get the swf file as well as the browser window.  I posted this in dreamweaver, but I was told that it is a problem of action script.

    I found a simple solution, and I think that's what you're looking for.

    1. in Flash, go to file > publishing settings

    2. click on the HTML tab

    3. where is says Dimensions, select percentage

    4. Although it is probably by default, make sure that the width and height are both set to 100.

    5. click OK, then go to file > publish

    Now your film must evolve with the browser window.

    If you do not have Flash, you can simple work with this sample code below:


       
       
       
       
       
       
    align = "middle" allowScriptAccess = "sameDomain" allowFullScreen = "false" type = "application/x-shockwave-flash".
    pluginspage ="http://www.macromedia.com/go/getflashplayer" / > "

    Notice how the width and height are set to "100%"? That's all you need.

  • Firefox 4.0 is now compatible with the browser ZoneAlarm 1.5.260.0 and Windows Vista Home Premium, 64-bit Service Pack 2 system?

    Firefox 4.0 is now compatible with the browser ZoneAlarm 1.5.260.0 and Windows Vista Home Premium, 64-bit Service Pack 2 system? Earlier when checking for updates it had compatibility problems. These issues have been resolved for me operation secure with Firefox 4.0?

    According to the guru on the ZoneAlarm user forum, Firefox 4 and other new browsers won't be compatible with the new version of ZoneAlarm, releasing. See:

    "You must update the following plugin:

    • Adobe PDF plugin for Firefox and Netscape 8.2.6
    1. Check your plugin versions on one of the following links:

    2. Update of Adobe Reader (PDF plugin):
      • Within your existing Adobe (If you have already installed) drive:

        • Open the Adobe Reader program in your list of programs
        • Click Help > check for updates
        • Follow the instructions to update
        • If this method works for you, go to the section "download full installer ' below and go to"after the installation"below
      • Download the full installer (If you have NOT installed Adobe Reader):
      • After installation, launch Firefox and recheck your version.
  • The interface of the AVI with the PC using LabWindows/CVI

    Hi friends,

    I have a vector Network Analyzer Keysight Technologies / Agilent Technologies N5230A. I want to run with the LabWindows/CVI to measure channel 40 GHz. I want to interface the AVI with the PC using LabWindows/CVI. It is really essential for the measures, and I have no experience in doing these things. Would you please direct me to the best, easy as possible of this work? I'm really conscious of the fact that and thank you for your time and concern.

    Mohamed

    I have a vector Network Analyzer Keysight Technologies / Agilent Technologies N5230A. I want to run it with the LabWindows/CVI and measure channel 40 GHz. I want to interface the AVI with the PC using LabWindows/CVI. It is really essential to me, and I have no experience in doing these things. Would you please direct me to the track better, easy and correct these work? I'm really conscious of the fact that and thank you for your time and concern.

    Mohamed

  • How to communicate with the gsm using lab view

    Please, someone tell me about the following uncertainties:

    1 can anyone tell me about the GSM part in lab mode?

    2. how to communicate with the GSM using lab view?

    3. how to publish my data through GSM using lab view?

    4. how to use ipod to send data to laboratory?

    5. what a DAC suitable for ipod?

    6. how to install the lab for ipod DAC mode?

    without worrying

    FR. mohammad rehan

    rehan_the_great wrote:

    Can u please tell me the minimum requirement of computer (labtop) for the use of labview, like ram size, HARD drive, map chart etc...

    A simple search for "labview requirements" on this site would have given you the information you want.

    http://www.NI.com/LabVIEW/requirements/

  • can I create custom context menus? Can I use Push technology? With the browser?

    Anyone know if I can create custom context menus? Also, can I use Push technology? I vibrate the device? With the browser?

    Just try to clarify to make sure I understood the question.  The browser does not support the menu adding items to the BlackBerry menu (I don't know how tell - the menu that is displayed when you press the menu key on the BlackBerry). Java applications are.  You could build something in JavaScript (on 4.6 and later) who gave you menus, but it does not fire when the menu button has been pushed.

  • Is it possible to load your phone with the Office using the cord with head phone the ends of both sides?

    Is it possible to load your phone with the Office using the cord with head phone the ends of both sides?

    No, only USB.

    Taken head phones don't have any power.

  • Train with webutil works with the browser, but not with webstart JNLP 12 c

    Hello

    I set up forms and reports suite 12 c according to the instructions and I'm testing my forms updated since version 10 g.

    In some forms, I use webutil.

    I can run forms without webutil with the browser or java web start (everything works fine).

    I have problems with the forms use webutil tha, they work very well with the browser, but not with java web start.

    When I run forms with webutil and webstart I see all white and the "crash" application: I must leave because other forms without webutil also do not work.

    Here is my config in formsweb.cfg:

    [Appws] <-start java web

    form = nomeform

    Archive = frmall.jar, frmicons.jar

    WebUtilArchive = jacob.jar, frmwebutil.jar

    WebUtilTrustInternal = true

    WebUtilLogging = off

    WebUtilLoggingDetail = normal

    WebUtilErrorMode = alert

    WebUtilDispatchMonitorInterval = 5

    WebUtilTrustInternal = true

    WebUtilMaxTransferSize = 16384

    baseHTML = webutilbase.htm

    baseHTMLjpi = webutiljpi.htm

    basejnlp = webutil.jnlp

    WebStart = on

    [appnows] <-no java web start

    shape = mercurio

    separateFrame = true

    Archive = frmall.jar, frmicons.jar

    WebUtilArchive = jacob.jar, frmwebutil.jar

    WebUtilTrustInternal = true

    WebUtilLogging = off

    WebUtilLoggingDetail = normal

    WebUtilErrorMode = alert

    WebUtilDispatchMonitorInterval = 5

    WebUtilTrustInternal = true

    WebUtilMaxTransferSize = 16384

    baseHTML = webutilbase.htm

    baseHTMLjpi = webutiljpi.htm

    basejnlp = webutil.jnlp

    What could be the problem?

    Gianpaolo

    Remove Appws:

    Archive = frmall.jar, frmicons.jar

    WebUtilArchive = jacob.jar, frmwebutil.jar

    baseHTML = webutilbase.htm

    baseHTMLjpi = webutiljpi.htm

    Add frmicons.jar and jacob.jar to $ORACLE_HOME/forms/java/extensions.jnlp.

    and try again.

    Concerning

  • Preview in the browser used to display multiple options

    When I started using muse there was a cascading list to choose among the options in the browser

    Now they're all gone and only a default browser is used

    they saw in the browser used to display the

    Internet

    9

    8

    7

    size of window options

    chrome

    Firefox

    Anyone suggest how these disappeared or how to get the lst to re - appear?

    An excerpt of the sizes are available for the provisions of the Tablet and phone. They are not available for the provisions of office you can always install different browsers on your pc and check how the site looks like.

    You may also want to check out this site, http://browsershots.org/

    - Abhishek Maurya

  • All of a sudden, I see not the line I draw with the tool pen in Adobe Illustrator?  I don't see points.

    In general, the line drawing shows that I create points with the pen tool.  Suddenly, he stopped it.  I need to see the lines.

    Colleen,

    If I (put) understand, you can enable elastic and here:

    Preferences > anchor and selection display

  • How to continue the drawing with the pen tool

    Hello

    Let's say that I start to draw an image with the pen tool. Something happens 1/2 through the work of track and I need to stop the trace. How I later come back and start the trace of my last point and continue to the end. Now, all I get is new anchor points and lines that do not join the original track. Thank you

    To resume adding segments to a pre-existing open path with the pen tool:

    1. Hover over the endpoint of the path. A slash mark appears next to the cursor.
    2. Click on the endpoint.
    3. Continue to add the anchorPoints.

    It is not necessary first to select the path (but it should be).

    JET.

  • Drawing with the pen tool or the line Segment tool

    Hello

    I have need of tips and tricks to draw the design of a singlet. What is the way most appropriate for the task? What should I draw the line one by one, or create a model brush to draw? Please refer to the image as an attachment for a better understanding. Thanks in advance.

    draw.jpg

    There is a lot to address the issue. Myself, I will draw all the basic shapes with the pen and shape tools (there really only 5 different forms in the main design), application of rounded corners effect according to the needs and duplication/reflection needed to reproduce the layout. So I "would make the cuts" on the forms by using additional objects... many positioned with step & repeat and/or mixture... and apply Pathfinder operations.

  • 'Holes' when you draw with the Brush tool

    pinselstrich.jpg

    Hello, why I get this 'hole' when I shoot with the Illustrator brush stroke, and how can I change it? (Illustrator CS6)

    Drag the brush in the Panel forms.

    Select the shape of the brush with direct selection

    Open the Atrributes

    Define the shape of the brush to the fill rule 'Non-Zero' (you must "Display options" to make visible buttons)

    And of course then Alt-do drag the brush published in the Panel forms once again, replacing the old.

  • How to start to draw with the pen tool, a different anchor point?

    It's as simple as that. How can I change the anchor point where I paint. I use the tool on Illustrator CS6 pen on a tablet.

    Thank you!!!

    for8aby,

    Guides are your friends, depending on whether you want to continue A) the shape of the path (so far) last anchor Point or B) create a new path starting with an internal Anchor Point with the pen tool:

    (A) right click/ClickDrag on/off the last anchor Point;

    (B) click anywhere near the internal Anchor Point, press space, and move the point on the path ( pathcommented for example) until you're here

    (Smart Guides say anchor), and then drag the handles, as appropriate.

    After that, you can continue as ususal.

Maybe you are looking for

  • New 8460p USB 3.0 not 3.0

    Hello, just bought a p 8460 and find that, whatever the building from scratch or using preload usb 3.0 ports seem to run on 2.0. Whenever I have to plug a device 3.0 in one of them (left side) I get a message always plug a my devices in a 3.0 port. I

  • OfficeJet Pro 8600 spits out a blank second page when receiving faxes

    I have a brank new Officejet Pro8600 and it's the same as my last HP all-in-one has started doing.  Even if he receives only one fax from page, it seems to read as two pages and also spits out a blank second page. My frustration is more, because I ju

  • IdeaPad y580 brightness keys don't work

    I just got my IdeaPad y580 and quickly installed windows 7 64. I downloaded and installed a bunch of drivers, including energy one. After installing that one my brightness orders have begun to display the OSD, but it doesn't actually change the brght

  • Laptop HP dv7 Envy: drive hard short dst check failed

    Hello Today, I rebooted my computer because of the fingerprint does not.  When I turned it back I got the HP logo and it saying preparation repair, then it goes to a white screen.  I did a diagnostic test and got this: check DST short of hard drive:

  • BBM BBM for Samsung Galaxy Note surveys

    Hello support team, I would like to ask your help nicely. In fact, I had registered my e-mail yesterday to use BBM to my Samsung Note 3 but I have not received confirmation of Blackberry e-mail and I'm still on the waiting list. Can you please help m