How to draw a line when running

I need to draw a line at run time, and I found this myShape.graphics.moveTo '(100, 100);  myShape.graphics.lineTo (200, 200); "but do not know with certainty how to declare myShape, I think he needs 2 lines to declare correctly, right?

:

var myShape:Shape = new Shape();

addChild (myShape);

myShape.graphics.moveTo (100, 100);

myShape.graphics.lineTo (200, 200);

Tags: Adobe Animate

Similar Questions

  • How to add multiple lines when the button is clicked

    How to add multiple lines when the click on button now is just add a row .plz give me idea how... waiting for answer

    / public final class screen extends MyScreen
    {
    /**
    * Creates a new object of MyScreen
    */
    ObjectChoiceField obj1 obj2, obj3, obj4.
    Table of String() = {'101 ', ' 102'};
    String of shadow [] = {"Shade1", "Shade2"};
    Rolls of string [] = {'101 ', ' 102'};
    String cutting [] = {"100-150", "150-200"};
    Chain of selectedindex1, selectedindex2, selectedindex3, selectedindex4;
    LabelField lbl1 lbl2, lbl3, lbl4;
        
    GFM LinedGridFieldManager;
    HFM HorizontalFieldManager, hfm1, hfm2 hfm3;
    VerticalFieldManager vfmMain;
        
    public MyScreen()
    {
        
    Set the displayed title of the screen
    hfm1 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    hfm2 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    hfm3 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    HFM = new HorizontalFieldManager (HorizontalFieldManager.FIELD_RIGHT);
    vfmMain = new VerticalFieldManager (Manager.NO_VERTICAL_SCROLL |) Manager.NO_HORIZONTAL_SCROLLBAR);
            
    obj1 = new ObjectChoiceField ("", graph, 0, FIELD_LEFT);
    obj2 = new ObjectChoiceField ("", blind, 0, FIELD_LEFT);
    Obj3 = new ObjectChoiceField ("", rolls, 0, FIELD_LEFT);
    Obj4 = new ObjectChoiceField ("", cuts, 0, FIELD_LEFT);
            
    LBL1 = new LabelField("");
    LBL2 = new LabelField("");
    lbl3 = new LabelField("");
    lbl4 = new LabelField("");
            
    ButtonField btnAdd = new ButtonField ("ADD", FIELD_RIGHT);
            
    GFM = new LinedGridFieldManager (4, LinedGridFieldManager.VERTICAL_SCROLL);
            
    hfm1.setMargin (20, 0, 10, 0);
    hfm1. Add (new LabelField ("Chart"));
    hfm1. Add (obj1);
    hfm1. Add (new LabelField ("Shade"));
    hfm1. Add (obj2);
            
    hfm2. Add (new LabelField ("Rolls"));
    hfm2. Add (Obj3);
    hfm2. Add (new LabelField ("Cuts"));
    hfm2. Add (Obj4);
    HFM. Add (btnAdd);
            
    GFM. Add (new LabelField ("Chart"));
    GFM. Add (new LabelField ("Shade"));
    GFM. Add (new LabelField ("Rolls"));
    GFM. Add (new LabelField ("Cuts"));
            
    vfmMain.add (hfm1);
    vfmMain.add (hfm2);
    vfmMain.add (hfm3);
    vfmMain.add (hfm);
    vfmMain.add (new SeparatorField());
    vfmMain.add (gfm);
    Add (vfmMain);
            
    btnAdd.setChangeListener (new FieldChangeListener()
    {
    ' Public Sub fieldChanged (field field, int context) {}
    TODO self-generating method stub
    selectedindex1 = chart [obj1.getSelectedIndex ()];
    selectedindex2 = shade [obj2.getSelectedIndex ()];
    selectedindex3 = rolls [obj3.getSelectedIndex ()];
    selectedindex4 = cuts [obj4.getSelectedIndex ()];
                    
    While (LBL1. GetText(). Equals("") | LBL2. GetText(). Equals("") | lbl3. GetText(). Equals("") | lbl4. GetText(). Equals(""))
    {
    LBL1. SetText (selectedindex1);
    LBL2. SetText (selectedindex2);
    lbl3. SetText (selectedindex3);
    lbl4. SetText (selectedindex4);
                    
    GFM. Add (LBL1);
    GFM. Add (LBL2);
    GFM. Add (lbl3);
    GFM. Add (lbl4);
                    
    }
    }
    });
    }
    }

    Hi Piya,

    I run your code, and according to your logic that it works correctly.

    It's adding that line only once because according to your logic that one line can be added to MDT, if you do not want to add line on each click on the button, follow these steps:

    selectedindex1 = chart [obj1.getSelectedIndex ()];
    selectedindex2 = shade [obj2.getSelectedIndex ()];
    selectedindex3 = rolls [obj3.getSelectedIndex ()];
    selectedindex4 = cuts [obj4.getSelectedIndex ()];

    Lbl1 LabelField = new LabelField("");
    Lbl2 LabelField = new LabelField("");
    LabelField lbl3 = new LabelField("");
    LabelField lbl4 = new LabelField("");
    If (LBL1. GetText(). Equals("") | LBL2. GetText(). Equals("") | lbl3. GetText(). Equals("") | lbl4. GetText(). Equals(""))
    {
    LBL1. SetText (selectedindex1);
    LBL2. SetText (selectedindex2);
    lbl3. SetText (selectedindex3);
    lbl4. SetText (selectedindex4);
                    
    GFM. Add (LBL1);
    GFM. Add (LBL2);
    GFM. Add (lbl3);
    GFM. Add (lbl4);
                    
    }

  • How to draw a line between two buttons?

    Hello.

    I want to do two mobile buttons attached to a line. When changing the position of any button you change in the appearance of the line of course.  I know how to draw a line, but after MOUSE_DOWN and I don't know how to remove an old monotube and how this line to appear all the time?

    My code

    btn2.addEventListener (MouseEvent.MOUSE_DOWN,
    mouseDownHandler3);
    btn2.addEventListener (MouseEvent.MOUSE_UP, mouseUpHandler3);
    btn3.addEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler3);
    btn3.addEventListener (MouseEvent.MOUSE_UP, mouseUpHandler3);

    Set a mouse down Manager (the user is dragging)
    function mouseDownHandler3(evt:MouseEvent):void {}
    var object = evt.target;
    We have to limit them by dragging to the area inside the canvas
    object.startDrag ();
    }
    function mouseUpHandler3(evt:MouseEvent):void {}
    var obj = evt.target;
    obj.stopDrag ();
    spisujemy x, y
    var x2Pos:Number = btn2.x;
    var y2Pos:Number = btn2.y;
    var x3Pos:Number = btn3.x;
    var y3Pos:Number = btn3.y;
    trace (x3Pos);
    trace (y3Pos);
    var roundObject:Shape = new Shape();
    roundObject.graphics.lineStyle (2, 0 x 990000,. 75);
    roundObject.graphics.moveTo (x2Pos, y2Pos);
    roundObject.graphics.lineTo (x3Pos, y3Pos);
    this.addChild (roundObject);
    this.removeChild (this.getChildAt (this.numChildren-1));
    }

    Source. FLA: http://www.mediafire.com/?y2tyzz4zxun

    Here is a solution that you can adapt for two or more buttons...

    var btns:Array = [btn2, btn3]; instances in concert

    handlers all btn
    function setBtns (): void {}
    for (var i = 0; i)
    inclinometer [i] .buttonMode = true;
    inclinometer [i] .addEventListener (MouseEvent.MOUSE_DOWN, grab);
    inclinometer [i] .addEventListener (MouseEvent.MOUSE_UP, drop);
    }
    }

    setBtns();

    inspired by ECCAS btns lines all while occurs wildfire
    function drawLines(e:Event=null):void {}
    Graphics.Clear;
    graphics.lineStyle (2, 0xFF0000);
    ((graphics.moveTo(btns[0].x+(btns[0].width/2), btns[0].y+(btns[0].height/2));

    for (var j = btns.length - 1; j > = 1; j-) {}
    ((graphics.lineTo(btns[j].x+(btns[j].width/2), btns[j].y+(btns[j].height/2));
    }
    }

    managers
    function grab(event:MouseEvent):void {}
    event.target.startDrag ();
    addEventListener (Event.ENTER_FRAME, drawLines);

    }

    function drop(event:MouseEvent):void {}
    event.target.stopDrag ();
    removeEventListener (Event.ENTER_FRAME, drawLines);

    }

    drawLines();

  • How to add two lines when the second row is not visible, but also gets the first data line too?

    Mr President

    Jdev worm is 12.2.1

    How to add two lines when the second row is not visible, but also gets the first data line too?

    I want to add two lines like below picture, but want the second to remain invisible.

    tworows.png

    I asked this question but my way of asking was wrong, that's why for me once again.

    Concerning

    Try to follow these steps:

    1. in the database table to add the new column "JOIN_COLUMN" and add the new sequence "JOIN_SEQ".

    2. Add this new column in the entity object. (You can add this in entity object by right clicking on the entity object and then select "Synchronize with database" then the new column and press on sync)

    3. in your bookmark create button to create only one line NOT 2 rows.

    4 - Open the object entity--> java--> java class--> on the entity object class generate and Tick tick on the accessors and methods of data manipulation

    5 - Open the generated class to EntityImpl and go to the doDML method and write this code

      protected void doDML(int operation, TransactionEvent e)
      {
        if(operation == DML_INSERT)
        {
          SequenceImpl seq = new SequenceImpl("JOIN_SEQ", getDBTransaction());
          oracle.jbo.domain.Number seqValue = seq.getSequenceNumber();
          setJoinColumn(seqValue);
          insertSecondRowInDatabase(getAttribute1(), getAttribute2(), getAttribute3(), getJoinColumn());
        }
    
        if(operation == DML_UPDATE)
        {
          updateSecondRowInDatabase(getAttribute1(), getAttribute2(), getAttribute3(), getJoinColumn());
        }
    
        super.doDML(operation, e);
      }
    
      private void insertSecondRowInDatabase(Object value1, Object value2, Object value3, Object joinColumn)
      {
        PreparedStatement stat = null;
        try
        {
          String sql = "Insert into table_name (COLUMN_1,COLUMN_2,COLUMN_3,JOIN_COLUMN, HIDDEN_COLUMN) values ('" + value1 + "','" + value2 + "','" + value3 + "','" + joinColumn + "', 1)";
          stat = getDBTransaction().createPreparedStatement(sql, 1);
          stat.executeUpdate();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
        finally
        {
          try
          {
            stat.close();
          }
          catch (Exception e)
          {
            e.printStackTrace();
          }
        }
      }
    
      private void updateSecondRowInDatabase(Object value1, Object value2, Object value3, Object joinColumn)
      {
        PreparedStatement stat = null;
        try
        {
          String sql = "update table_name set column_1='" + value1 + "', column_2='" + value2 + "', column_3='" + value3 + "' where JOIN_COLUMN='" + joinColumn + "'";
          stat = getDBTransaction().createPreparedStatement(sql, 1);
          stat.executeUpdate();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
        finally
        {
          try
          {
            stat.close();
          }
          catch (Exception e)
          {
            e.printStackTrace();
          }
        }
      }
    
  • I have Adobe Acrobat XI and can not know how to draw a line.  I need to redline some documents but can not.  Does version XI even not this feature?

    I have Adobe Acrobat XI and can not know how to draw a line.  I need to redline some documents but can not.  Does version XI even not this feature?

    Yes, Acrobat Pro XI and standard have this ability.
    There is the comment > Annotations > online tool.
    There is the comment > Annotations > tool bar.

    In the Properties dialog box for one, you can select a desired color (i.e. red).
    So, in properties, you can check a choice to make this the default value of the tool.

    Basically, all versions of Acrobat (including the new "DC") offer this feature.

    If you work with a scanned image that has been placed in the PDF don't forget to use the OCR to get an output of a 'real' text - Acrobat provides a feature of OCR.

    Be well...

  • How to draw the line under STROKE and fill of an object in illustrator cc? Ideas: D...

    How to draw the line under STROKE and fill of an object in illustrator cc? Any ideas ...

    Aleksandar,

    If I (put) understand it, you will need to divide the object. You can:

    (1) select the object and Ctrl / Cmd + C + F, and then remove the filling of the copy and the blow of the original;

    Draw 2) and drag the new piece down between Division 1 objects) in the layers palette, or select 1 copy) and Ctrl / Cmd + C + F + X + F or similar.

  • How to draw a line in Muse?

    I think that it is a stupid Questtion, but I can't.

    How to draw a line?

    Draw a rectangle with 1 Pixel in height and no respect.

    If you want to dashed or dotted lines:

    http://forums.Adobe.com/ideas/1944#comment-5008

  • How to draw a line (with the line segment tool) then draw another line, from those previous anchor point. When I try immediately draw another line on the other anchor lines it try to turn instead.

    I'm following a course of basic fundamental illustrator on Lynda. The video of "draw straight lines" is troubling me. They draw a line with the line segment and then draw another line coming out the anchor point at an angle.

    Here's where it is troubling me - when I try to drag a line to the anchor point trying to transform the first line, I drew. (the line cursor turns into a selection tool) I can't draw another line connecting the first.

    Advice would be great because it's driving crazy me.

    See you soon,.
    Kyle

    Yes, it is irritating. You must clear the previous line first. If you want to make sure that both ends are perfectly aligned, start by turning on the guides. If you want two lines to be part of the same way, you should use the tool pen instead.

  • How to draw a line on Illustrator uses Excel via VBA coordinates

    Void line_viaCoordinates()

    Set appRef = CreateObject ("Illustrator.Application")

    IAPP Dim As New Illustrator.Application

    Dim idoc as Illustrator.Document

    Dim Illustrator.PathItem As isquare

    Define the idoc = iapp. Documents.Add

    Dim lineList (4)

    lineList (0) = Array (50, 50)

    lineList (1) = Array (50, 100)

    lineList (2) = Array (100, 100)

    lineList (3) = Array (150, 80)

    lineList (4) = Array (90, 200)

    "my question is: how to turn this painting (50, 50) in table (LINE B1, RANGEC1)..." So whatever the number, I type this cell to Excel, Illustator it will use as input to draw the line.

    Define isquare idoc =. PathItems.Add

    iSQUARE. SetEntirePath (lineList)

    Isquare = Nothing set

    Define the idoc = Nothing

    Define the iapp = Nothing

    End Sub

    You can use the range or cell objects to get a reference to your range values

    in this example, the data is on the A1 to B5

    Dim lineList(4)
    
    lineList(0) = Array(Cells(1, 1).Value, Cells(1, 2).Value)
    lineList(1) = Array(Cells(2, 1).Value, Cells(2, 2).Value)
    lineList(2) = Array(Cells(3, 1).Value, Cells(3, 2).Value)
    lineList(3) = Array(Cells(4, 1).Value, Cells(4, 2).Value)
    lineList(4) = Array(Cells(5, 1).Value, Cells(5, 2).Value)
    
  • How to draw a line under the first paragraph

    Hello

    I am trying to solve a problem: my text field should be divided into two parts, horizontally. First part is intended for a log book, and the second is for the body. I need to divide them visually tracing a line between them. The logic is to take the first paragraph and make a summary. The rest is the body. So I need to be able to get the height of the first paragraph in order to draw the line at the right position. And I will have to adjust its position whenever the user scrolls the text.

    Any ideas how to on this subject?

    see you soon,

    Jan

    There is a discussion about the various ways to do it in this thread:

    http://forums.Adobe.com/message/3382440#3382440

    You will also find the recent message on the blog useful:

    http://blogs.Adobe.com/tlf/2011/01/decoration-example.html

    -robin

  • FLVPlayback - how to specify source fla when running

    I am a total newbie with Flash.

    We want to host video on our site. The video display is selected by the user. I wanted to use the FLVPlayback component to display the video by specifying the URL of the source of the .fla file when running in the HTML code of the page. I have no idea how to access the source property when running in the object tag or whatever. Obviously, I need to learn the Actionscript to understand, but can someone give me a simple example of how it would be done or point me to a tutorial on this?

    The object tag looks like this:

    < object classid = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase ="" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9, 0,0,0 " width ="550"height ="400"id ="Viewer"align ="middle">"
    < param name = "allowScriptAccess" value = "sameDomain" / >
    < param name = "allowFullScreen" value = "false" / >
    "" "< param name ="movie"value =" viewer.swf"/ > < param name = value of 'quality' = 'high' / > < param name ="bgcolor"="#ffffff"value / > < embed src =" viewer.swf "quality ="high"bgcolor ="#ffffff"width ="550"height ="400"name ="Viewer"align ="middle"allowScriptAccess ="sameDomain"allowFullScreen ="false"type =" application/x-shockwave-flash"pluginspage =" http://www.macromedia.com/go/getflashplayer ' / >
    < / object >

    There is also a javascript function:

    AC_FL_RunContent)
    'codebase', ' http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9, 0,0,0',
    'width', '550'.
    'height', '400',
    'src', 'drive ',.
    'quality', 'high ',.
    "pluginspage", ' http://www.macromedia.com/go/getflashplayer ", "
    "align", "middle",
    'play', 'true ',.
    'loop', 'true ',.
    "scale", "showall"
    'wmode', 'window ',.
    "devicefont", "false."
    'id', 'drive ',.
    'bgcolor', '#ffffff ',.
    "name", "viewer",.
    'menu', 'true ',.
    'allowFullScreen', 'false. '
    "allowScriptAccess", "sameDomain",.
    'film', 'the observer ',.
    "salign", "
    ); end AC code

    It's a question of falling in the code here, or I need to change my viewer.swf to accept the parameter?


    Seems to be quotes in the flashVars parm. I removed the and it works now.

    Thanks for listening!

  • How to draw a line on a pic

    CCan I draw a line on a photo in the photo app. ??

    No, but there are many annotation applications in the App Store. To start try Skitch.

    Almost all drawing applications allow you to set photos, then draw over them, too.

  • How to draw the lines automatically

    In LabVIEW I must draw a line automatically (both vertically and horizontally) the user will define the vertical and horizontal number lines.

    Is this possible with LabVIEW

    Thanks in advance

    You move to the point of departure of the line using "move the pen", and then draw the line using "draw the line".

    Repeat for each line. (using for example a for loop and autoindexing on positions).

  • How to draw a line in Captivate 8?

    I must be missing something obvious, but there is no option of the straight line in the menu forms in Captivate 8 as it was in version 7. and I can't find any other way to draw a line of in Captivate.  I spent some time looking for the forum and the web but only found references using the forms menu in earlier versions.  What Miss me?

    Some features are missing for reactive projects: http://helpx.adobe.com/captivate/kb/top-issues-captivate-8.html

    Ray, free polygon and free forms are on the list. But for normal projects is available. Problem is that not all the form are visible under the large button shapes, you must choose one, then go to the properties panel to see more in this category. Space-saving, I agree.

  • How to draw a line without anti-aliasing?

    I need to create lines for the selected underline buttons in a video menu. If I create a straight line with the line drawing tool line is anti-aliased. According to the position, it has more or less anti-aliasing and as yet will not display the colo complete them lines have different thickness or length. Is it possible turn of anti-aliasing for the daw line tool? I saw no option.

    As a solution, I found only the possibility to use the selection tool and then fill it out. The resulting sharp edges.

    Marcus

    Shape layers are always smoothed, but the nature of the beast, if the shape is not exactly on the limits of the pixels.

    The question is not to disable anti-aliasing, which is impossible for a shape layer - the trick is to get the shape traced on the limits of the pixels.

    Unfortunately there is no option to draw lines on the limits of pixels, but because of some options new added by the Adobe creative team you CAN draw rectangles on the limits of the pixels by selecting the rectangle tool and choosing this option:

    -Christmas

Maybe you are looking for

  • Satellite L10 151 does not load XP or drive recovery

    Hello I have a model of Satellite L10-151, and he won windows load t. Whenever I have try and run it, it says operating system not found. When I put the Toshiba recovery disks in that came with the laptop and I also bought a windows XP disk this load

  • small bug in the FLUKE PM668x driver, where the report?

    Hello just stumbled upon a minor bug in the FLUKE PM668x driver provided in the section of the driver. One ',' too in a format string in a cfg - vi to config: 6681 to a closed totaling. Where to report? However, I add the vi has changed.

  • Location of the taskbar

    After an update my taskbar showed on the right margin of my screen.How to return it to the bottom of the screen?

  • FixIt center operating system is not compatible Windows and update does not work due to 8007066

    I have an Asus Essentio with Windows 7 Professional. Although the computer was working ok, I installed the FIX It Professional [I bought it to install on my computer to girls] for the interview. Since then, I had several problems with slow MSN Mail a

  • BlackBerry Smartphone Internet connection / 3G

    So I just noticed that I have not received emails, and I can't connect to the internet. Under 'Manage connections', I checked all the connections, but under the heading "Services status", Blackberry Internet Service and Blackberry Enterprise Server s