How to record draws lines?

Hello

My goal is to make a flash application that can do these things:

-drawing application database (I can handle this part)

-Save the user features

-save data that record each moves in a single file, let's call my-design-data file

-load my-design-data file into the flash application

-reading my-design-data file in order to watch a kind of movie that shows the drawing who 'draw' itself

A good example of this application can be found on drawingnow.com. So I know it's possible but how...?

Any ideas how they do?

Hello

Here is a very rough idea on how to record and playback of drawing.

Capture the drawing:

-drawing points are stored in a table "_pointArray".

-the "_pointArray" coded JSON is published on the server.

-Next - server, save the string in a file or a database.

          private function mouseDownHandler(e:MouseEvent):void{

               //start new segment
               moveTo(stage.mouseX,stage.mouseY);

               //mark the point as starting point , "newline=true"
               _pointArray.push({x:stage.mouseX, y:stage.mouseY, time:getTimer(), newline:true});

          }

          private function mouseMoveHandler(e:MouseEvent):void{
               if(e.buttonDown){

                    //draw line
                    drawLine(stage.mouseX, stage.mouseY);

                    //record the points
                    _pointArray.push({x:stage.mouseX, y:stage.mouseY, time:getTimer()});

               }
          }

          private function moveTo(x:Number, y:Number):void{
               this.graphics.moveTo(x,y);
          }

          private function drawLine(x:Number, y:Number):void{
               this.graphics.lineTo(x,y);
          }

          private function saveData():void{
               var json:JSONEncoder = new JSONEncoder(_pointArray);
               var urlVariable:URLVariables = new URLVariables();
               var urlRequest:URLRequest = new URLRequest('{URL_TO_POST_AND_SAVE_POINTS}');

               urlVariable.points = json.getString();
               urlRequest.method = URLRequestMethod.POST;
               urlRequest.data = urlVariable;

               var urlLoader:URLLoader = new URLLoader();

               urlLoader.load(urlRequest);
               urlLoader.addEventListener(Event.COMPLETE, saveCompleteHandler);

          }

          private function saveCompleteHandler(e:Event):void{
               trace("Saved the animation");
          }

Load and replay the animation:

-load the json string

-Decode the json string to array

-Playback of the animation

                         private function loadData():void{
                    var urlRequest:URLRequest = new URLRequest('{REQUEST_URL_TO_LOAD_POINTS}');
                    var urlLoader:URLLoader = new URLLoader();
                    urlLoader.addEventListener(Event.COMPLETE,loadCompleteHandler);
                    urlLoader.load(urlRequest);
               }

               private function loadCompleteHandler(e:Event):void{
                    var loader:URLLoader = e.target as URLLoader;
                    var json:JSONDecoder = new JSONDecoder(loader.data as String);
                    _pointArray = json.getValue() as Array;

                    //start the animation
                    playAnimation();
               }

               //Playback the drawing on an EnterFrame/Timer event
               private function playBackHandler(e:Event):void{
                    var nextPoint:Object = _pointArray[_currentIndex];
                    var nextMilliSec:Number =  nextPoint.time;
                    var timeLapsed:Number = getTimer() - _startTime;

                    while(timeLapsed >= nextMilliSec){
                         if(nextPoint.newline){
                              //stating point
                              moveTo(nextPoint.x, nextPoint.y);
                         }else{
                              //draw line
                              drawLine(nextPoint.x, nextPoint.y);
                         }

                         //next array index
                         _currentIndex++;

                         //reached the end?
                         if(_currentIndex >= _pointArray.length){
                              stopPlayBack();
                              break;
                         }else{
                              nextPoint = _pointArray[_currentIndex];
                              nextMilliSec =  nextPoint.time;
                         }

                    }
               }

Kadiatou

Tags: Adobe Animate

Similar Questions

  • How to record the line with mbp and el capitan

    How can I burn online with a MBP 15 beginning and El Capitan?

    Set the audio input of your computer...

    How to record audio on Mac OS X EL Capitan

  • How can I draw a line around the edge of a piece of property that I shot a video clip of 13 elements?

    How can I draw a line around the edge of a piece of real estate in a video clip with 13 elements?

    KING OF THE SKY

    First 13 items on what operating system? Have you updated 13 to 13.1 still using Help Menu/updates to date of an open project?

    Your question immediately... you could try something like this

    In this scenario, you start with your video on video 1 track with the Timeline indicator placed in the appropriate location of content timeline.

    The Titler line file created will be automatically placed at the position of the indicator in the timeline.

    Text Menu/New/default of titration / and select the Section forms.

    The Titler file goes to Video Track 2 above the video on the video 1 track.

    Select the line tool in the section shapes and draw your line on screen correspond to the where you want it to appear in the video below.

    Your image of the line is the line on transparent background where the content below shows through the transparent areas in this image of the line.

    Please consider. If any questions or need any clarification on the above, do not hesitate to ask.

    Thank you.

    RTA

  • using annotations of drawing, line free hand; How can you apply a fill or shadow of the object/area?

    using annotations of drawing, line free hand; How can you apply a fill or shadow of the object/area?

    You can not. The fill color property applies only to the following observation

    types: circle, square, line, Polygon, PolyLine, FreeText

  • How to draw lines on a map with CS4

    I have CS4 and would like to know how to draw lines on a map image. I'm a beginner, so what do I do?

    It's about CS6, but CS4 would be a similar process:

    Here's a way to draw a line:

    Select the pen tool.

    Make a new layer which will be placed on top of the existing layer in the map.

    Draw a line with the pen tool, you can see the points that I made to create curves.

    Here is more information on the pen tool: http://psd.tutsplus.com/tutorials/tools-tips/photoshops-pen-tool-the-comprehensive-guide/

    http://www.Tutorial9.NET/tutorials/Photoshop-tutorials/pen-tool-basics-in-Photoshop/

    In Photoshop, you have to go back to the options bar and select "shape". This allows you to place a 'coup' on the path (line) that you just created. Otherwise, it will not be displayed.

    You can see the settings in the Option bar above, I did. I made that Fill was placed on 'none', and I chose a color for my race, but also a point of size for the thickness of the line until its visible on my card.

    It comes to the final.

    Good luck!

    Janelle

  • How can I draw a line at 40 ° c in windows7 paint

    Hello

    I use the part of Paint in Windows 7 and I would like to know if I can draw lines with angles varoiuse 30 and 60 degrees

    Best regards, Nigel Terry

    Unfortunately, the painting doesn't have this feature.

    The best we can do would be to select the grid and the leaders of the view tab, in the paint can use base for a right triangle trigonometry - see:

    Trigonometric functions (Wikipedia) .

    The foregoing would be very tedious, time-consuming and probably too imprecise.

    A better option would be to seek a 3rd part of the program, possibly a design (CAD) program assisted by computer. You will need to consider as you know what exactly it is you are trying to reach.

  • draw lines on the graph of the intensity

    I want to draw lines on the graph of the intensity.

    I am already looking for some questions before.

    I know there is a vi could draw line on the graph of the intensity by dragging the mouse.

    But I need more precisely what set the length and the angle between the horzontal line.

    The setting is very ideal for me. But I don't know how to use it in the intensity chart.

    Is there anyone can help or give some advice?

    Your example is not so great because it uses 100% of CPU on a kernel at any time, do nothing.

    Here's a quick rewrite of my old example here. He draws an angle with the specified length and angle to where you click on the chart. This should help you get started. Modify if needed. (Also remember that trigonometry is much easier when using complex numbers )

  • laptop HP pavilion 17 64-bit: draw lines on your desktop

    can someone explain how to draw lines on the desktop? I am currently working on a project that requires lines to be drawn on some of the pictures on the desk. to make things more complicated, I don't use a mouse, and my computer has not left and right click buttons! He has a very sensitive touchpad, so there is not to hold a left or right button as possible on most computers. so, for the moment I tenderly your help there, to try to solve this problem. If there is a solution, that is! I have to admit that this is something new for me, but you live and learn to do not you?

    Thank you very much in anticipation.

    Glad to hear the clicks of mouse work for you about the graphics program, it seems that you need something which will give you a fairly accurate line length measurement while you draw the line is - that correct? Photoshop Elements can meet your needs. In my opinion, it costs about $80.

    In Photoshop Elements, while using the online tool, it gives you a measure of angle in real-time and (to the thousandth inch) length of the line you draw. Here is a picture to demonstrate:

    Only a slight glimpse of the line appears while you actively draw, then the complete line appears after you release the mouse button. You can customize the line to any desired pixel width. Each new line creates a new layer 'Shape' on top of your image, which can then be resized or moved or otherwise handled, according to the needs.

    I hope this helps. Your assignment seems deceptively simple please let me know if there is anything else I can do to help.

  • draw lines on a map in paint

    Hello

    How to draw a line on a map in the painting of windows 7 with the line tool?  in older versions of paint, I could draw a line and click and then move to the next area.  in windows 7, I can draw a line, but there are two white dots at each end.  I clicked, double clicked, right click... nothing changes.  the only way to get the line to stay on the plan is to stick and the back arrow.  If I paint multiple directions on a map, it gets old fast.

    so, how to draw any line of the size of the point a to point b and he can stay?

    Thank you

    After experimenting with the whole program, I can now draw lines and place them where they should go on any card.  He just took the time to experiment and try different methods.

  • How the records are selected in the database

    Hello

    How the records are selected in the database


    Thank you.

    Read articles on JDBC, here is what I understand...

    If I set LignesMax = 1 (in out select adapter DB) and I have 30 record in the table that satisfy the select query then what line is picked up? the first in the table or randomly any folder?

    The query returns the first line of the result set.  Not just a random line.  However, to get the rows to return in the result set in a specific order, you must include an order by clause, or the query will return rows in random order.

    And if I set LignesMax = 0 (unbounded, means any number registration) in this case if my select query satisfy 100 million documents so all million records will be picked up once, in one cycle?

    The answer to this depends on the size of the extraction of the query.  If the size of the extraction is > = 100 million, everything goes back in a single cycle of the DB.  If< 100="" million,="" then="" it="" will="" be="" divided="" into="" multiple="" trips="" to="" the="">

  • How to animate a line with the pen tool to give the impression that it is plotted?

    How to animate a line with the pen tool to give the impression that it is plotted?

    Or you can choose the pen tool (g), set the padding to zero and the race to what you want, then draw a path, then press U twice to reveal all of the properties that have been changed for the layer, and then click Add (top-right) and select Connect the tracks.

    To make the race work just animate the start or end point and sent to paint on original or reveal original or normal.

  • circles and drawing lines

    How to draw lines and circles? Thank you.

    Using various annotation tools available under the comment Panel.

    We sea, Sept. 23. 2015 00:48, peterg21588935 [email protected]>

  • Draw lines around shapes

    Hi guys,.


    I love this design and would try to do it as an exercise.


    Captura de pantalla 2015-06-26 a la(s) 10.44.23.png


    Captura de pantalla 2015-06-26 a la(s) 10.44.39.png


    Captura de pantalla 2015-06-26 a la(s) 10.44.02.png

    How you think is the best way to draw lines around a circle. I know it's better to draw the line and then apply "Offset" or this will avoid the future edition and changes.

    In addition it is very interesting the transparency / multiply effect when two colors mix.

    Thanks for any advice!

    Best,

    Hi SebastiaoV,

    I would first create circles and position them.

    Then (with Smart Guides turned on), I would create the path by using the centers of the circles.

    Race as thick as you want and use round caps and rounded corners.

    Make another layer and repeat with different colours.

    Tone

  • What should I use to draw lines on a map?

    Is it a drawing of the tool that you can attach to your computer to draw lines? The cursor is not precise enough to draw lines on a map (jpeg). Is there a tool I can buy and fix to draw on my screen using PS?

    Thank you post again - I recommend no doubt using the pen for what you are trying to do. Trying to map free hand lines is very difficult, but the pen tool offers precise control. I have outlined some steps for you to follow below.

    1. open your image and select the Pen tool from the toolbar, as shown below.

    2. I would recommend zoom in your image to make it easier for you to track on the lines of the complex plane. To do this, select view > Zoom In, or hitting "control +" (Windows) or ' command + ' (Mac) on your keyboard.

    3. then create a new layer by clicking the new layer in the layers panel, as shown below. Draw your lines of card on a new layer to preserve your original map image in case you make a mistake or want to start over.

    4 using the Pen tool, tracing on the lines of the map of your boot image. Here I begin to Bellevue and suite I90 to Ellensburg. Using the tool pen takes some practice. To get detailed help about how to use the pen tool, watch videos of Terry White I linked in my previous post.

    5. Once you have finished tracing over the lines of the map, go in the tracks Panel by clicking on the "Paths" tab in your layers panel.

    6. in the tracks Panel, click the icon of the path highlighted below. This caresseront the way you created using your most recent Brush tool settings - I will go into this more again to the next step.

    7. you can see that the way that I created with my pen tool has been rubbed with yellow and aligns very well with the original line of the card. You can change the size and color of your run by selecting the Brush tool in the toolbar and clicking the tools described below.

    8. when I have to zoom out, you can see I have drawn precisely the line of the card. I did it very quickly so with patience, you can create extremely accurate map lines.

    I highly recommend watching the video of Terry White on how to use the pen tool. The pen tool is the best way to create very relevant and precise lines apart from the purchase of an external drawing tablet.

    I hope this has helped! Good luck!

  • How to make a line intersect with a path at random angles?

    How to make a line intersect with the anchor point of a half circle when you want the line to continue beyond the anchor point of the half circle at an angle to randomly?

    Now that I saw your picture, I understand the problem. You must make the careful construction work.

    Take a look at this:

    Start by drawing your circle. Drag the ruler guides (here dotted lines) so that they snap into its Center C.

    Drag another landmark of rule to your point of origin O.

    With the Pen or line tool Segment a line of O to T A. setting by the eye as precisely as possible with the end of it A directly selected.

    A copy of the line OA rotate 90 °. Using smart guides, drag the new line until it crosses the center of the Circle C.

    Direct, select the end of your original line and move it to T until the smart guides say "cross".

    Now, with the selected OA line use the scale tool. O-click and drag to 45 degrees by holding the Shift key. Your line will extend over its own length.

    In order to take account of the OA line across the circle just use the Reflect tool. Select the line, an Option, click the horizontal guide and copy reflect across the horizontal axis through the dialog box.

Maybe you are looking for

  • What happened to my old (female UI)?

    The user interface for my Shuffle (4th generation) has recently changed (during an update?) of a female voice for a male voice and has stopped working properly. The user interface does not recognize the names of playlist (just 1 Playlist, Playlist 2,

  • How will I know if Tempro alerts are actually active?

    How can I know if alerts Tempro (facial recognition software, etc.) are actually active?When I download, they load in a file download, but I don't know if this means that they are used. Am I missing something, something wrong, either, etc.? Or I do t

  • DVD Super Multi Drive problem - cannot access any CD - Satellite A100

    Hi, 1st post: My Satellite A100 features a DVD Super Multi drive, which worked very well. However I cannot now access any CD - error message ' D: / is not accessible. The request could not be performed because of an i/o device error."is displayed. Ho

  • EliteBook Notebook PC 8460p: impossible to uninstall HP Protectools

    I'm trying to upgrade to Win 10.  It says that I need to uninstall HP Protectools because it is not compatible.  When you try to uninstall protectools, I get the lollowing error: Error: 1325.Hewlett - Packard is not a valid short file name. No idea h

  • NET Framework 2.0 does not install on XP

    I am trying to install quicken 2011, currently have 2008. When installing, I get error that reads "Net Framework 2.0 Failed to Install. Quicken requires net framework 2.0 must be installed to work correctly. » I tried everything to solve this problem