Drawing preloader line with AS?

Hello
I have the following AS (2) in a preloader (which works - in
the sense that it loads the next page):
The preloader should have a coloured line which runs from
left to right about 0.25px thick.
Whenever I have tried to draw the line using a pencil, it
appears too thick, or uneven, or even goes from right to left.
I have noticed that if I occasionally delete efforts I do not
like, even the next page fails to load.
What I am asking here is if it would be possible to draw the
line in AS?
Thanks for any useful advice.
Steve

Hello Devendran
Many thanks for your post.
So I would use something like:
lineStyle( 1, 0xBDA0F2, 100 );
moveTo( x1, y1 );
lineTo( x2,y2 );
But how would I incorporate that into my current Preloader AS
(2)?
Many thanks.
Steve

Similar Messages

  • How to draw centre line with white background?

    Hi,
    I need to draw a centre line with white background on it. Now i'm doing it by pasting the main line in the background and giving it white so that it shows a white backgound. Is there a way to do just by drawing like normal lines. If we can, is it possible to control the white backgound only to show less than the original line in both ends. This is for illustrations i do for exploding views and i need to draw this line to show it as assembly drawing.
    Thanks
    Manoj

    1. Draw a white line segment of desired width (stroke weight) with round cap (Stroke panel) for the background line.
    2. Copy, Paste in Front
    3. Change to desired foreground color, butt cap, reduce stroke weight.
    4. Opt/Alt–drag foreground segment to overhang background segment by desired amount on both ends.
    5. Select both segments and drag to Brushes panel, choose Art Brush.
    6. In Art Brush Options choose Stretch Between Guides, drag guides somewhere to the inside of curve of round caps. (If in step 3 you chose black, set Colorization Method to Tints. Then you can select any color for the foreground segment by setting the stroke color.) Name the brush as you choose. Click OK.
    7. Draw any path and apply the brush.

  • How to change draw dashed line with arrowhead (not straight)?

    Hi friends,
    The following code sinept draws an arrowed line from a given point to the other point. I want to know how it can changed to be dashed line as well? I would appreciate it if anybody help me for doing such changes.
    Thanks in advance,
    Reza_mp
    import javax.swing.*;
    import java.awt.*;
    import java.util.ArrayList;
    public class ArrowExample extends JFrame
        enum ArrowHead {
            HEIGHT(10), WIDTH(10);
            int n;
            ArrowHead(int n) {this.n = n;}
            public int value() {return n;}
        java.util.List<Arrow> arrows;
        BasicStroke stroke;
        private class Arrow {
            Point start;
            Point end;
            Polygon arrowHead;
            public Arrow(Point start, Point end) {
                this.start = start;
                this.end = end;
                double direction = Math.atan2(end.y - start.y, end.x - start.x);
                System.out.println(direction * 180/Math.PI);
                arrowHead = new Polygon();
                arrowHead.addPoint(0, 0);
                Point p1 = rotate(ArrowHead.WIDTH.value()/2, ArrowHead.HEIGHT.value(), direction);
                arrowHead.addPoint(p1.x, p1.y);
                Point p2 = rotate(-ArrowHead.WIDTH.value()/2, ArrowHead.HEIGHT.value(), direction);
                arrowHead.addPoint(p2.x, p2.y);
                arrowHead.addPoint(0, 0);
                arrowHead.translate(end.x, end.y);
            public Point rotate(int x, int y, double dir) {
                Point p = new Point();
                double r = Math.sqrt(x*x + y*y);
                double theta = Math.atan2(y, x);
                p.setLocation(Math.round(r*Math.cos(theta + dir + Math.PI/2)),
                              Math.round(r*Math.sin(theta + dir + Math.PI/2)));
                return p;
            public void draw(Graphics2D g) {
                g.drawLine(start.x, start.y, end.x, end.y);
                g.drawPolygon(arrowHead);
                g.fillPolygon(arrowHead);
        public ArrowExample() {
            super("Arrows");
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            JPanel p = new JPanel() {
                protected void paintComponent(Graphics g) {
                    super.paintComponent(g);
                    Graphics2D g2d = (Graphics2D)g;
                    Stroke oldStroke = g2d.getStroke();
                    Color oldColor = g2d.getColor();
                    g2d.setStroke(stroke);
                    g2d.setColor(Color.black);
                    for (Arrow a : arrows)
                        a.draw(g2d);
                    g2d.setStroke(oldStroke);
                    g2d.setColor(oldColor);
            p.setBackground(Color.white);
            add(p, BorderLayout.CENTER);
            stroke = new BasicStroke(3);
            arrows = new ArrayList<Arrow>();
            arrows.add(new Arrow(new Point(10,10), new Point(100,100)));
            arrows.add(new Arrow(new Point(300,10), new Point(300,100)));
            arrows.add(new Arrow(new Point(450,450), new Point(400,100)));
            pack();
            setSize(500, 500);
        public static void main(String[] args) {
            setDefaultLookAndFeelDecorated(true);
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    new ArrowExample().setVisible(true);
    }

    Change the draw method as follows:
            public void draw(Graphics2D g) {
                Stroke s = g.getStroke();
                g.setStroke( new BasicStroke( 3.0f, BasicStroke.CAP_BUTT,
                   BasicStroke.JOIN_MITER, 1.0f, new float[] { 10.0f, 10.0f }, 0.0f ) );
                g.drawLine(start.x, start.y, end.x, end.y);
                g.setStroke( s );
                g.drawPolygon(arrowHead);
                g.fillPolygon(arrowHead);
            }

  • CS6 - Can't draw multiple lines with the same starting point consecutively without an extended pause between strokes. Ruins hatching and writing certain letters ("i" "E" etc.). Is this a normal limitation of flash?

    Question is in the title. I animate in a traditional style (frame-by-frame) and draw a lot. When I animated in photoshop, the only annoyance was that the interface was terrible in terms of animation flexibility, but performed so much better in terms of actually drawing the frames. I invested in flash because I've heard that it really speeds up the animation workflow, but I'm getting quite irritated by this bug. I never read about it in reviews, and it's not something that I've gotten results for by googling, so I'd really like to know. Is this a normal issue in flash? Or is this something that I can fix?  I've been trying to deal with it for a few weeks now but it's reaching a point where I just can't tolerate it anymore. I know I'm posting this in the CC community but I'd really really appreciate it if someone had a fix for this that I wasn't aware of, because otherwise I've wasted a lot of money.

    Question is in the title. I animate in a traditional style (frame-by-frame) and draw a lot. When I animated in photoshop, the only annoyance was that the interface was terrible in terms of animation flexibility, but performed so much better in terms of actually drawing the frames. I invested in flash because I've heard that it really speeds up the animation workflow, but I'm getting quite irritated by this bug. I never read about it in reviews, and it's not something that I've gotten results for by googling, so I'd really like to know. Is this a normal issue in flash? Or is this something that I can fix?  I've been trying to deal with it for a few weeks now but it's reaching a point where I just can't tolerate it anymore. I know I'm posting this in the CC community but I'd really really appreciate it if someone had a fix for this that I wasn't aware of, because otherwise I've wasted a lot of money.

  • How to draw a line with arrow head

    Hi,
    I have an application where i need to connect different
    components by line. I am able to connect the components by line but
    i dont know how i can add arrow to the line head or one end of
    line. When i drag line from a souce component to destination the
    line end at destination must have a pointed head i.e arrow.
    If any one have solution please reply..
    Thank you.

    Hi,
    I have an application where i need to connect different
    components by line. I am able to connect the components by line but
    i dont know how i can add arrow to the line head or one end of
    line. When i drag line from a souce component to destination the
    line end at destination must have a pointed head i.e arrow.
    If any one have solution please reply..
    Thank you.

  • How to draw and modify double lines with Adobe Illustrator?

    I need tot draw roadmaps. This should be easy using the pen tool, but my problem is that I cannot find a way to draw double lines with this tool. I have seen many fancy border styles and patterns. Some do have double or even quadruple lines, but the problem is than that they have an offset from the vector line and the space in between the two lines (the edges of the road) cannot be filled. Somewere I also found some pens called 'Double line 1.1' to 'Double line 1.6' but they also had an offset from the vector and I could not chance the size of the lines and the interval in between them independently.
    What I am looking for is a way to draw two lines in parallel and have the option tot fill the space in between with a color or even a pattern.
    The color and size of the lines should be changeable to make a distinction between several types of road.
    Is there an existing set of pencils for this purpose? It would be nice to be able to draw not only roads, but also railways and rivers!
    I am surely not the first person who needs to do this?
    I use AI version 6

    Jacob,
    Thanks for the answer. I have been searching for a solutions for a long
    time, but today I found the solution on a forum (not on this one). That
    solution is exactly as you described below, i.e. using a coloured line and a
    narrower white line on top of the first one. My problem was that I did not
    know how to create a custom brush based on the two lines. Now I know how to
    do that. However, I still have the problem. I can now draw double lines and
    I can change the color of the background line (the coloured one) but I
    cannot change the white colour of the narrower line. I assume that I have to
    completely redefine a new brush when I need to change that colour too.
    Regards,
    Rob Kole
    Van: Jacob Bugge [email protected]
    Verzonden: donderdag 28 maart 2013 17:04
    Aan: RKOLE
    Onderwerp: How to draw and modify double lines with Adobe
    Illustrator?
    Re: How to draw and modify double lines with Adobe Illustrator?
    created by Jacob Bugge <http://forums.adobe.com/people/Jacob+Bugge>  in
    Illustrator - View the full discussion
    <http://forums.adobe.com/message/5186535#5186535

  • How to draw a table with vertical&horizental lines inSAP-Standard script.

    actuvally my requirement is to place a table in script , if not possible is any posibilitie to draw a table using a vertical lines and horiental lines, if possible can u help me out, and if any sample code r any screen shot u have plz share with me....
    Message was edited by:
            phani kumar

    Hi,
    If have understood your problem correctly , you want to draw a table using script.
    You can refer this link which provides code for <b>drawing vector lines with javascript</b>
    http://www.thescripts.com/forum/thread88771.html
    Next u can also visit
    http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm
    This link contains code for <b>Drawing Table borders using JavaScript</b>
    http://forums.devshed.com/javascript-development-115/drawing-table-borders-using-javascript-44376.html
    Hope any one of them will help you.

  • How to draw line with width at my will

    Dear frineds:
    I have following code to draw lines, but I was required:
    [1]. draw this line with some required width such as 0.2 or 0.9 or any width at my will
    [2]. each line after I draw, when I use mouse to click on it, it will be selected and then I can delete it,
    Please advice how to do it or any good example??
    Thanks
    sunny
    package com.draw;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class DrawingArea extends JPanel
         Vector angledLines;
         Point startPoint = null;
         Point endPoint = null;
         Graphics g;
         public DrawingArea()
              angledLines = new Vector();
              setPreferredSize(new Dimension(500,500));
              MyMouseListener ml = new MyMouseListener();
              addMouseListener(ml);
              addMouseMotionListener(ml);
              setBackground(Color.white);
         public void paintComponent(Graphics g)
              // automatically called when repaint
              super.paintComponent(g);
              g.setColor(Color.black);
              g.setFont(getFont());
              AngledLine line;
              if (startPoint != null && endPoint != null)
                   // draw the current dragged line
                   g.drawLine(startPoint.x, startPoint.y, endPoint.x,endPoint.y);
              for (Enumeration e = angledLines.elements(); e.hasMoreElements();)
                   // draw all the angled lines
                   line = (AngledLine)e.nextElement();
                   g.drawPolyline(line.xPoints, line.yPoints, line.n);
         class MyMouseListener extends MouseInputAdapter
              public void mousePressed(MouseEvent e)
                   if (SwingUtilities.isLeftMouseButton(e))
                        startPoint = e.getPoint();
              public void mouseReleased(MouseEvent e)
                   if (SwingUtilities.isLeftMouseButton(e))
                        if (startPoint != null)
                             AngledLine line = new AngledLine(startPoint, e.getPoint(), true);
                             angledLines.add(line);
                             startPoint = null;
                             repaint();
              public void mouseDragged(MouseEvent e)
                   if (SwingUtilities.isLeftMouseButton(e))
                        if (startPoint != null)
                             endPoint = e.getPoint();
                             repaint();
              public void mouseClicked( MouseEvent e )
                   if (g == null)
                        g = getGraphics();
                   g.drawRect(10,10,20,20);
         class AngledLine
              // inner class for angled lines
              public int[] xPoints, yPoints;
              public int n = 2;
              public AngledLine(Point startPoint, Point endPoint, boolean left)
                   xPoints = new int[n];
                   yPoints = new int[n];
                   xPoints[0] = startPoint.x;
                   xPoints[1] = endPoint.x;
                   yPoints[0] = startPoint.y;
                   yPoints[1] = endPoint.y;
                   /*if (left)
                        xPoints[1] = startPoint.x;
                        yPoints[1] = endPoint.y;
                   else
                        xPoints[1] = endPoint.x;
                        yPoints[1] = startPoint.y;
         public static void main(String[] args)
              JFrame frame = new JFrame("Test angled lines");
              frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              DrawingArea d = new DrawingArea();
              frame.getContentPane().add( d );
              frame.pack();
              frame.setVisible(true);
    }Message was edited by:
    sunnymanman

    sonudevgan wrote:
    dear piz tell me how i can read integer from user my email id is [email protected]
    foolish, foolish question

  • Draw line with Gradient

    Hi,
    I am trying to implement drawing on canvas with two colors, red and blue.
    For example, to draw with the mouse "with two colors".
    I do not need a filled rectangle.
    I am looking into gradient but without any success.
    Is there a better way to draw a line with two colors?
    I also tried to use BasicStroke, but the line had an inner/outer strokes.
    Please help with suggestions.

    devboris wrote:
    ..For example, to draw with the mouse "with two colors".
    import java.awt.*;
    import javax.swing.*;
    class GradientLine {
        public static void main(String[] args) {
            GradientPanel gp = new GradientPanel();
            gp.setPreferredSize( new Dimension(600,400) );
            JOptionPane.showMessageDialog(null, gp);
    class GradientPanel extends JPanel {
        public void paintComponent(Graphics g) {
            // cast the Graphics objkect to a Graphics2D object
            // (G2D includes setPaint() method)
            Graphics2D g2 = (Graphics2D)g;
            GradientPaint bgPaint = new GradientPaint(
                0,
                0,
                Color.black,
                getWidth(),
                getHeight(),
                Color.white );
            g2.setPaint(bgPaint);
            g2.fillRect( 0, 0, getWidth(), getHeight() );
            GradientPaint fgPaint = new GradientPaint(
                0,
                0,
                Color.yellow,
                getWidth(),
                getHeight(),
                Color.red );
            // set the paint to a gradient.
            g2.setPaint(fgPaint);
            for (int ii=0; ii<getWidth()/10; ii++) {
                g2.drawLine( ii*10, 0, ii*10, getHeight() );
            for (int ii=0; ii<getHeight()/10; ii++) {
                g2.drawLine( 0, ii*15, getWidth(), ii*15 );
    }

  • Line with a arrow

    Hi All,
         I want to draw multiple line with a arrow.  Please guide me how can i do it by code dynamically. exactly as below.
    Regards,
    Kameshwaran A.

    create an empty symbol
    put this code in it.
    //***** Set some opening parameters
    onClipEvent (load) {
    //Make original line invisible
    _root.line._visible = 0;
    //Initiate some variables
    number_lines = 0;
    line_active = 0;
    //***** Every time the mouse button is released...
    onClipEvent (mouseUp) {
    //Get the position of the mouse
    origin_x = _xmouse;
    origin_y = _ymouse; 
    //Increase the number of lines by one 
    number_lines++; 
    //Generate a new line name 
    name = "line"+number_lines; 
    //Duplicate a new line 
    _root.line.duplicateMovieClip(name, number_lines); 
    //Position the line's end point at mouse position 
    _root[name]._x = origin_x; 
    _root[name]._y = origin_y; 
    //Update line length / orientation 
    _root[name]._xscale = _root._xmouse-origin_x; 
    _root[name]._yscale = _root._ymouse-origin_y; 
    //If this is the start of a new shape 
    if (!line_active) 
    //Set the line tracking variable 
    line_active = 1; 
    //Set the start point of the new shape 
    start_x = origin_x; 
    start_y = origin_y; 
    //***** Every time the mouse is moved 
    onClipEvent (mouseMove) { 
    //If there's a line currently being drawn... 
    if (line_active) 
    //Update line length / orientation 
    _root[name]._xscale = _root._xmouse-origin_x; 
    _root[name]._yscale = _root._ymouse-origin_y; 
    updateAfterEvent(); 
    //***** When a key is pressed 
    onClipEvent (enterFrame) { 
    //If it's the Enter key 
    if (Key.isDown(Key.ENTER)) 
    //Join the end point of this line... 
    //...to the start point of the first line in this shape 
    _root[name]._xscale = ""; 
    _root[name]._yscale = ""; 
    //Reset line-tracking variable 
    line_active = 0; 
    draw a line convert it to a symbol and give it an instance name of line.
    and there you can draw lines.
    detach the lines by pressing enter.
    and thats it.
    your welcome in advance (:
    INPORTANT to leave all your symbols in the scene not in the libery are it will not work
    Message was edited by: xFARRELLx

  • Can Flash create dashed line with blunt not rounded dashes ?

    Hi,
    using Flash8
    I can select line tool and dashed line in properties and draw a dashed line and get a line of sausages. How do I get a line of dashes without rounded ends to each dash ?
    Line option has end caps option with None (gives straight or blunt tip to line, round gives rounded tip .
    Draw a line with None and its got blunt ends, select it and choose dashed line option and it gets round ends to the dashes, the end cap option is greyed out !
    Are dashed lines with blunt dashes now possible again with CS4, a forum poster also found that CS3 no longer gave blunt dashes ?
    Why do I ask:-
    I am trying to bring a map into Flash8 from Illustrator (Illus version 10 as it allows blunt tip lines to remain blunt it was said on the forum)... which has blunt ends to roads and has blunt type dashed lines. The roads remain blunt..GOOD !..but the dashed lines become what looks like a solid line. BAD !
    I do a right click - break apart,  then double click one of those now solid lines that should be dashed, and I am able to select a portion of the line, it is no longer a continual line as drawn in Illustrator. Properties shows it as solid line. Flash8 obviously having a problem with supporting Illustrator 10 dashed line then !
    Select dashed in properties box and I get a portion of the line as sausage dashes, but working my way along the line doing each bit sees a far from correct dashed line result as sausages dont start stop evenly as each line is a separate entity and ignores the previous line.
    Looks like I shall have to try and draw the line as one long line again in flash but unless I can give it blunt dashes when done, there is no point even trying that method, hence my question.
    Would the latest Illustrator and Flash versions (CS4) allow blunt type dashed lines to appear in Flash ?
    This is crucial for bringing maps into Flash.
    Envirographics

    I noticed one problem with my solution.
    If you look, very carefully, at the end of the stream, it's flat. Not rounded like it should be. After a bit of trial and error, I tried a different brush:
    Note that, in addition to the rounded rectangle (done with the new corner controls in the latest version of Illustrator CC that just came out) and the three circles, there is also a rectangle, with no stroke and no fill, to provide a space at the end of the three dots. Here is the result:

  • Can j2me draw line with double values.

    Hi,
    Can any body know how to darw line in j2me with double values.
    I don't want use draw Line with int.
    Shall i use svg or j2me has solution.
    Thanks and regards,
    Rakesh.

    not possible
    graphics.drawLine(float,float,float,float);...there's no such method in MIDP API: [click here for javadoc of Graphics class methods|http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/lcdui/Graphics.html#drawLine(int,%20int,%20int,%20int)]

  • Draw line with float values possible

    Hi,
    Using Canvas drawing is possible to draw line with float values.
    graphics.drawLine(int,int,int,int);
    graphics.drawLine(float,float,float,float);Thanks and regards,
    Rakesh.

    not possible
    graphics.drawLine(float,float,float,float);...there's no such method in MIDP API: [click here for javadoc of Graphics class methods|http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/lcdui/Graphics.html#drawLine(int,%20int,%20int,%20int)]

  • I can't draw straight lines for fill-in-the-blank on my tests and worksheets. The "draw it yourself choice makes big fat lines and takes a lot of manipulation. Do I have to draw them myself with a pen and a ruler?

    I can't draw straight lines for fill-in-the-blank on tests and worksheets. The draw-it-yourself ooption gives me thick lines and is time-consuming. So, after all these years, do I have to go back to using a ruler and a pen?

    In Pages v5.0.1, the straight lines are already drawn for you in the Shape Tool. Before we go there, select Menu > View > Show Ruler.
    When you click on Shape in the Pages toolbar, the top left line is straight. Click it. It will drop into your document in a 45 degree angle. Grab the lower left selection grip and drag it up and to the right to position the horizontal line in the length of your choice. Use the Format: Style tab to manage the stroke weight. You can also choose Menu > Edit > Duplicate Selection (command+D) as a productivity tool.
    If you move from the Format: Style tab to the Arrange tab, you can compare the start and end points with where you want the line positioned on the ruler. Once you have it positioned, notice the Lock button, also on the Format: Arrange tab.

  • How to draw a globe with lines of lattitude and longitude?

    I'm using CS4 on a Mac.
    Can anyone tell me how to draw a globe with a grid? I need 7 lines of latitude and 40 lines of longitude (i.e. separated by 9 degrees). I would like to have each segment of the grid defined as shape so I can fill each one with a different color.

    Maybe this way can help.....

Maybe you are looking for

  • How can I add Rescue E-mail? Please Help

    Hi, I'm Having trouble solving security question. So, I contacted Apple Tech support and they gave me this link. http://support.apple.com/kb/ht5312?viewlocale=en_US I don't have Rescue E-mail option on my Password and security tab.  And I was wonderi

  • Problem Deploying a JDeveloper SOA Application (Task details application)

    Hi, I am unable to access Taskdetails through worklist application I was able to deploy the sample composite for VacationRequest on soa server, and the same is visible in Oracle BPM worklist, but when the taskflow application for human task for the s

  • Different ways to create a blog entry

    I'm using iWeb '08. I have set up several blog pages and want to allow people to update them outside of iWeb. Is there a way to accomplish this?

  • Podcasts Missing on iPod

    Hi, I have a 5th generation 30GB iPod, which worked fine until I recently did a "Restore iPod". Now its mostly working fine except for the following: Podcasts appear in iTunes as expected, but after syncing my iPod, do not appear in the iPod's "Podca

  • File ChunkedRead option in File/FTP adaptor

    Hi All, My requirement is to process the husge file, which i copied to local SOA server. I want to leverage the chunkread opertaion , Could anyone worked on this. Please help me in undersatnding this feature, how i can leverage this in my current pro