Simple line extend animations

I am working on a pretty straight-forward motion graphic, that requires lines to extend in various directions via animation. I made one attempt, but feel like my way of doing this – making a small square, then motion tweening it to extend can not be the best way to do this – as I am manually extending each square to make each line, but am running into a lot of alignment / shifts.
Any help, or direction to help would be appreciated. thanks.

One way to do this would be to use a tweening engine like TweenLite - it has an onUpdate feature that will call a function every time the tween is updated... so you can animate some invisible object from point a to point b - and use the graphics api to draw a line to the objects current position. If you have TweenLite give this bit of code a try - it will draw a red line from 0,0 to 550,400 over the course of 5 seconds:
import gs.TweenLite;
var ob:Sprite = new Sprite();
ob.x = 0;
ob.y = 0;
TweenLite.to(ob, 5, {x:550, y:400, onUpdate:drawLine});
function drawLine(){
    graphics.clear();
    graphics.lineStyle(1, 0xFF0000);
    graphics.moveTo(0,0);
    graphics.lineTo(ob.x, ob.y);

Similar Messages

  • Simple line drawing project in swing

    hi folks,
    i want to write a simple line drawing project. it has a JPanel, a JFrame and JButton.
    JPanel and JButton are on JFrame. When Button is clicked,
    a line will be added to JPanel but previous lines which have been added are not removed on JPanel.
    Could you please help me?

    i wrote below codes but it adds first line but when click button �n order to add line, it is not adding line. Please help and thanxs...
    import java.awt.BasicStroke;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.geom.Line2D;
    import java.util.Enumeration;
    import java.util.Vector;
    import javax.swing.JButton;
    import javax.swing.JComponent;
    import javax.swing.WindowConstants;
    import javax.swing.SwingUtilities;
    public class NewJFrame extends javax.swing.JFrame implements ActionListener {
         private JButton addButton;
         MainPanel mainPane ;
         public Vector lines ;
         * Auto-generated main method to display this JFrame
         public static void main(String[] args) {
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        NewJFrame inst = new NewJFrame();
                        inst.getContentPane().add(new MainPanel(inst.lines));
                        inst.setLocationRelativeTo(null);
                        inst.setVisible(true);
         public NewJFrame() {
              super();
              initGUI();
              lines = new Vector();
              lines.add(0, 30);
              addButton.addActionListener(this);
         private void initGUI() {
              try {
                   setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
                        addButton = new JButton();
                        getContentPane().add(addButton, BorderLayout.SOUTH);
                        addButton.setText("ADD");
                        addButton.setPreferredSize(new java.awt.Dimension(71, 21));
                   pack();
                   setSize(400, 300);
              } catch (Exception e) {
                   e.printStackTrace();
         @Override
         public void actionPerformed(ActionEvent e) {
              if(e.getSource() == addButton){
                   lines.addElement(Integer.parseInt(lines.get(0).toString())+30);
                   mainPane.repaint();
    class MainPanel extends JComponent {
         Vector tempLines ;
         MainPanel(Vector lines){
              tempLines = lines;
              setBackground(Color.white);
         public void paintComponent(Graphics g) {
              Enumeration enumeration = tempLines.elements();
              while(enumeration.hasMoreElements()) {
                   Integer point = Integer.parseInt(enumeration.nextElement().toString());
                   Line2D line = new Line2D.Double(30, point, 200, point);
         Graphics2D g2d = (Graphics2D)g;
         g2d.setStroke(new BasicStroke(5));
         g2d.draw(line);
    }

  • Simple line graph problem

    Hi there,
    I want to create a very simple line graph, containing 1 line. Therefore i create a Graph.LINE_VERT_ABS type Graph and add the data using myGraph.setLocalRelationalData(al ArrayList). This arraylist contains values in the form of
    setname jan 12.2
    setname feb 14.5
    setname march 8.1
    etc
    When i do this, I get the errormessage: "The data has an insufficient number of columns. This graph type requires at least 2 columns of data. The data provided has one column.".
    When i add another dummy value to the arraylist:
    dummy dummya 1
    dummy dummyb 2
    the graph displays correctly, but only with a additional line for the dummy values, also in the Legend.
    What am i doing wrong. Surely it is possible to display just one line in the Graph??
    Any help is appreciated.
    Linda

    In the arraylist, setname identifies a column. By default, columns are plotted as groups, or different points along the horizontal axis. In order to have a line or area graph, you need two groups. The data that you are passing has 1 group and 3 series. You should pass it as follows:
    jan setname 12.2
    feb setname 14.5
    march setname 8.1
    etc.
    Passing data like this will give you three groups (jan, feb, march) and one series (setname).
    By the way, what version of BI Beans are you using and how did find out about setLocalRelationalData? That API was never publicly released. It was replaced by setTabularData (same method renamed) and exposed in 9.0.3.
    BI Beans Product Management

  • HOW TO display a simple line of text if the user isn't logged in and not display it if they are?!?!?

    there must be a way to display a simple line of text (or a link) if the user isn't logged in (as wholesale customer), and not display it if they are?!?!?
    it's a basic kind of <php echo> var type of function.... there must be an equivalent in this BC system..... anyone?!?!?     PLEASE!
    thank you
    Chris.

    ok, after chattting with LIVE SUPPORT i've discovered {module_isloggedin}
    now i just need to integrate it into my Online Store modules!

  • In Preview, the simple line annotation seems to have been removed. When I select the tool, there is an arrow annotation instead of the simple line earlier.

    The simple line annotation in the Preview Application seems to have been replaced rather oddly by an arrow. I wish to use the simple line in a PDF document without an arrow at the end. Its a very important annotation that I use very frequently.

    Choose line width at the top of this pull-down in the Annotate tools. Choose simple lines, right, left or two-way arrows at the bottom of the pull-down...

  • Simple lines now not compiling

    I added the Netbeans profiler to my app this morning. I don't know if that has anything to do with my problem specifically, but for some reason, simple lines that I add in are acting very weird now. For instance, the below line asks for another " )". Without this line, the program compiles fine so I know it's not the result of another () not being closed. Both variables are strings. What am I not seeing?
    System.out.println("Path of " + userURL "is " + pathURL);

    yeah, I can go to every closing bracket in Netbeans and it will highlight the opening one. They are all there. I'll post the if block that I'm referring to to see if someone sees something that I don't:
                                if(tempURL.trim().startsWith(baseURL.toString()) && !tempURL.trim().toLowerCase().endsWith("js") && !tempURL.trim().startsWith("#"))
                                    try
                                        HttpURLConnection con = (HttpURLConnection) pageLinks.getRequest().getURL().openConnection();
    int respcode=con.getResponseCode();
    con.disconnect();
    if (respcode != 200 || respcode != 202)
    FileWriter writer = new FileWriter("Not_Found.txt", true);
    writer.write(System.getProperty("line.separator") + pageLinks[i].getRequest().getURL());
    writer.close();
    else
    WebLinkQueue.add(pageLinks[i].getRequest().getURL());
    try
    FileWriter writer = new FileWriter("Processed.txt", true);
    writer.write(System.getProperty("line.separator") + pageLinks[i].getRequest().getURL());
    writer.close();
    catch(IOException e)
    logger.debug("Could not write " + userURL + " to not processed file");
    catch(java.net.MalformedURLException me)
    logger.debug("pageLinks HTTPCon block: " + me.getMessage());
    catch(java.io.IOException ie)
    logger.debug("pageLinks HTTPCon block: " + ie.getMessage());
    else if(!tempURL.trim().startsWith("#") && tempURL.trim().startsWith(baseURL.toString()));
    notProcessed.add(pageLinks[i].getRequest().getURL().toString());
    try
    FileWriter writer = new FileWriter("Not_Processed.txt", true);
    writer.write(System.getProperty("line.separator") + pageLinks[i].getRequest().getURL());
    writer.close();
    catch(IOException e)
    logger.debug("Could not write " + userURL + " to not processed file");
    else if(!tempURL.trim().startsWith("#")) //error here
    try
    FileWriter writer = new FileWriter("External.txt", true);
    writer.write(System.getProperty("line.separator") + pageLinks[i].getRequest().getURL());
    writer.close();
    catch(IOException e)
    logger.debug("Could not write " + userURL + " to not processed file");

  • I want to make a simple line chart

    i want to make a simple line chart using the data in two nonadjacent columns.
    it seems that the easiest way to do this is to export the sheet to google docs and use THEIR charting, which is a two-click deal.
    is there an easy way to do this in numbers?
    my impression:
    numbers:
    very fancy, super pretty, easy to modify APPEARANCE, difficult to use actual charts. custom paint job on a junker
    googledocs:
    available everywhere, basic, more difficult with actual data flexibility, but you can use what you've got.
    the whole emphasis on numbers seems to be how pretty i can make displays, but not a lot of emphasis on making it easy to make things work.
    can anyone shed some light on how to make this simple instead of pretty?

    You can definitely use the technique I mentioned to order the columns to make it easy to chart:
    Here I created a table (the top one) to hold the original data and make a second table (the lower one) to pull data into two adjacent columns:
    The bottom table, as I said pulls data from the top data table:
    Then highlight the data in the table to chart, and selec the chart type from the menu (I suggest the bar chart which is the first item in the chart tool menu):
    I made up this data and mean it to be no reflection on your running ability 

  • Simple Line Chart - Values over time

    A simple line chart displaying a set of values over time would seem to be a very easy report to design. I'll be darned if I can see how to design it. Can anyone shed some light?
    I have provided links to a report and a spreadsheet which is the report datasource. My actual report will use SQL Server as its datasource. I am providing ths excel based example for the sake of protability.You will need to set the datasource location after saving the files to your hard drive.
    I can get the lines to draw properly, what I cannot figure out is how to specify the datetime values for the x axis. The column I would like to use on the x-axis is called DerivedLoggingTime.
    I'd also like to get control of the logarithmic algorithm used to formulate the y-axis values. I am not always happy with the values that the log algorithm comes up with.
    Any help is greatly appreciated.
    [Link to report|http://www.usol.com/~joe/linechart.rpt]
    [Link to spreadsheet|http://www.usol.com/~joe/AnalysisResults.xls]
    Another discovery while working on this report - our database will be SQL 2008 and  we are making use of the datetime2 datatype. CR appears to be treating this datatype as text. So when working with the SQL based datasource, I had to cast datetime2 columns as datetime in order for CR to see the columns as datetime instead of text. This is fine in this instance because the granularity of the datetime values for this particular report does not require datetime2, but that will not always be the case. CR will need to recognize the new datatype.
    Edited by: Joe Sytniak on Jul 17, 2008 5:37 PM

    Hi Joe,
    The Date Axis Line Chart of the Numeric Axis Type Chart, can be used to display data on a regular interval of days, Months and Years. The information displayed can unfortunately not be more granular that days.
    This type of chart is generally used when the data is recorded on irregular intervals in the database, and to make sense of the information stored it needs to be displayed at regular intervals.
    Since the data stored in your data source seems to be stored every 4 minutes, it will not be necessary to use this type of chart. I will suggest to use the regular line chart instead.
    To create a line chart using your date time field and value:
    1. Select "Chart" under the menu "Insert"
    2. Insert the chart on your report in the desired section.
        ( Group Header # 3 in your case. )
    3. In the "Chart Expert" window, under the tab "Type",
        change the chart type to a line chart by selecting "Line" in
        the "Chart Type" list.
    4. Under the tab "Data", add the database field that contains the Date Time information under the "On change of" list.
    (In your case, add the "DerivedLoggingTime" database field)
    5. To display the data for each minute, select the database fields you just added under the "On Change of" list, and
    click on the button "Order". In the "Chart Sort Order" window,
    select "For each minutes" in the "Section will be printed" drop down list, then click "OK"
    6. Add the field you want to display the value in the "Show Value List", then click "OK"
    Now it will display a line chart as desired, but since there is a lots of data point on your chart, the x axis date time labels will overlap each other. To avoid  this situation, I will suggest to skip labels.
    To format a chart to skip labels:
    1. In the "Preview" tab of the report, select one of the x axis label, and right click on it. In the contextual menu, select "Group (X) Axis Options..."
    2. In the "Group (X) Axis Settings" window, under the tab "Layout", check the option "Skip Group Labels" and set the value to 15 for example.
    Now, it will display the date time label at every 15 data point.
    As for your question on how get control of the logarithmic algorithm used to formulate the y-axis values, we unfortunately do not have much control over it other than:
    - Entering static values, or
    - Checking or Unchecking the option "Use Logarithmic scales"
    The above options are available on the y axis. To change those options:
    1. In the "Preview" tab of the report, select one of the y axis label, and right click on it. In the contextual menu, select "Group (Y) Axis Options..."
    2. In the "Group (Y) Axis Settings" window, under the tab "Scales", you will see the following options:
    - Minimum Values
    - Maximum Values
    - Use Logarithmic scales
    I will suggest to check the option "Use Logarithmic scales"
    Finally, as for the issue you discovered where SQL Server 2008 data type DateTime2 is converted to a string in Crystal Reports 2008, it is important to note that SQL Server 2008 hasn't been released yet, therefore it has not been tested in Crystal Reports 2008. Once SQL Server 2008 is released, I will suggest to test it again using the ODBC driver provided with this new version. 
    At this point I am assuming that this is happening because it is a new data type and an unknown data type get converted to string.

  • How do I create a line-Map animation effect

    How do I create a Line-Map animation effect?
    i am trying to highlight a 'Route' on a map.

    Are you using PSE or Premiere Elements? You can't do this in PSE. For PRE, better to ask in their forum, since very few of us here use it:
    http://forums.adobe.com/community/premiere_elements

  • Help me with a simple line-graph, plzzzzzzzz.

    hi!
    can anyone give me the basic java code to create a simple line graph for my java program output.
    thanks a lot in advance.
    cheers!

    Have a look at the Graphics.drawPolyline() method.
    kind regards,
    Jos

  • Looking for simple line drawing program [Solved]

    I am looking for a simple line drawing program with the following features :
    command-driven ( line, circle, ellips and such commands)
    used commands need to be exportable or copyable
    2D
    a canvas with arbitrary size
    libreoffice Draw, Koffice Karbon and xfig are not suitable for this.
    I have some experience with Autocad, but no access to that anymore.
    Any suggestions ?
    Last edited by Lone_Wolf (2011-04-03 13:34:57)

    keenerd wrote:For really simple stuff (and extremely keyboard driven!) I'll make an SVG by hand.  Any xml aware text editor works great.  The spec is pretty simple.  Use an image viewer that will automatically redraw when the SVG is updated.
    +1 http://www.w3schools.com/svg/tryit.asp? … 1&type=svg
    I think TeX can draw alright.
    A bunch of links - never tried them, don't know if they even work:
    http://www.ribbonsoft.com/qcad.html
    http://www.linuxcad.com/
    http://ipe7.sourceforge.net/
    Last edited by karol (2011-04-03 01:12:44)

  • A simple Line...

    I am very new to the swing enviroment and would be very grateful is someone could show me the simpliest way to create a simple line using the 2D package.
    Thank you.

    Hi friend.
    I suggest that you should search in the forum for similar topics or the internet.
    http://java.sun.com/docs/books/tutorial/2d/overview/index.html
    http://forum.java.sun.com/thread.jspa?forumID=20&threadID=683873
    Good luck with you work ;)

  • Can i extend my ap express through a power line extender

    I have an Apple Extreme with an ethernet cable to a Powerline adapter. The other end (in the far bedroom) the powerline adapter is ethernet wired to an Express. Will this extend my wireless network. The reason is this, I was using Facetime in the living room as I walked to the bedroom I dropped the connection only to pick up a strong signal in there. Make sense?

    No, unfortunately you are going to off on the wrong track and it will be hard to get back on the right one.
    You need step by step. We can provide that but we need a few details about your devices. If you have recent AirPort routers and you are using Mountain Lion or Mavericks, the setup will be very simple.
    What model number of AirPort Extreme?  If you are not sure, is this a new "tower" shaped AirPort Extreme, a flat "square" Extreme, or a round "dome" shaped Extreme?
    What model number of AirPort Express? If an older model, look on the side of the device for the model number. Hard to see in the faint print. It starts with an "A" followed by four numbers, as in A1264 or A1392 on the bottom of the newer version of the Express.
    What operating system are you using on your Mac?  If you are no sure, click the Apple icon in the upper left corner of the screen, then click About This Mac and post back with the OS X Version number that you see there.

  • Line Chart Animation?

    I need to add animation to a Line Chart something similar to the one shown in Windows Task manager under performance tab.
    Can anyone please tell me how to do that?

    Hi,
       I think this might be useful
    http://dougmccune.com/blog/2007/06/03/save-a-snapshot-image-of-a-flex-app-without-a-server /

  • MBP 17" 2010: horizontal lines extending out from open windows on 30" ACD?

    I have a mid-2010 17" I7 with anti-glare screen. The topcase was replaced for factory damage and now the screen was replaced by Apple here in Paris, where I live. I use the MBP with a 30" ACD at home, with no problems until I picked up the repaired MBP yesterday with new screen. I now notice that when I open a window, like Safari or Mail, the lines (let's call it the lower line that frames the menu bar in grey on the top of each open window) seems to extend beyond the open window and run across the top of the entire 30" display. If I move the window, that line moves across the screen with it. It doesn't occur on the MBP screen itself, only on the attached 30". So that if you open Safari and place it in the center of the external display, you see the line running from the grey menu bar on top of the window extend out in both direction across the entire display. It has no effect within the windows you are looking at all, but this wasn't there, or I never noticed it before. I changed the desktop background to see if it changed, and basically not, except it is not viewable so much with light or white background.
    There is no effect within the windows being viewed. It's as if the line running out from the frame of the window, especially the bottom part of the grey menu bar on top, are extending out across the screen.
    Any suggestions would be greatly appreciated.

    It turns out that I tested my 30" ACD with a friends Macbook and it has the same phenomenon. It's quite strange. The darker the blue or grey the more this line flows out from the grey bar frame on Safari or Mail windows. The smaller the window the less evident the phenomenon. Again, it has no effect on the windows themselves, and only occurs toward the top of the display. When you move the window down on the screen it disappears. And it is only the line below the grey upper bar that is rather bold that bleeds out across the screen.
    I wonder if there is a way to reset the display or move to some default setting that would correct this.

Maybe you are looking for

  • Excise invoice not capturing during migo?

    when I tried to capture the excise invoice during Migo. I am unable to select the capture only option. it is automatically selecting "refer only excise invoice"? how to solve this problem.

  • I restored my phone and now receiver is not working

    My phone crashed several times in the last week while on the road.  It would Go into auto shutdown.  I restarted it and would get the same error.  Finally I did a reset.  I could not plug into iTunes since I am on the road. NOw my ringer does not wor

  • Problems with 6300 and jabra BT 250v

    Trying to get these two to work together, ut everytime i try to get the phone to pair with the headset, it comes back as finding no devices... Has anyone else had similar problems? Can anyone offer any solutions or advice? Cheers

  • First Aid Failed while trying to re-start mac, help??

    My Mac has been forzen to the loading page and I have put in the grey disk to try and re-boot it and I was told to repair the disk once the CD was in. After having gone through part of the repair process I get a message of First Aid Failed because "T

  • Show ResultSet on the Browser

    Hiii I'm developing a servlet that get data from the database and i want to show the result of this data on the browser ... how could i do that if my data are saved in a ResultSet variable ??? thank you