How to draw a line in a rectangle

Following is the code:

var child: Shape = new Shape();
child.graphics.beginFill (bgColor);
child.graphics.lineStyle (borderSize, borderColor);
child.graphics.drawRoundRect (0, 0, size, size, cornerRadius);
child.graphics.endFill ();
addChild (child);

How can I draw a string inside the rounded rectangle?

Thank you!

April

I hear you :)

The string is therefore a combination of characters one... zA... Z1... 9 and so on, right?

If so, use flash.text.TextField object to display the strings http://livedocs.adobe.com/flex/2/langref/flash/text/TextField.html

package {}
import flash.display.Sprite;
import flash.text.TextField;
import flash.filters.DropShadowFilter;
SerializableAttribute public class HelloWorld extends Sprite {}
public function HelloWorld() {}
var shad: DropShadowFilter = new DropShadowFilter (2, 45, 0 x 000000, 25, 3, 3, 2, 2);
var txt:TextField = new TextField();
txt.textColor = 0xFFFFFF;
txt.filters = [shad];
txt. Width = 120;
txt.x = Math.random () * 300;
txt.y = Math.random () * 300;
txt. Selectable = false;
txt. Text = "Hello everyone welcome! ["+ Math.round (txt.x) +", "+ Math.round (txt.y) +"] « ;
addChild (txt);
}
}
}

Tags: Flex

Similar Questions

  • 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

  • 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 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 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 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);

  • 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

  • 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

  • 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 (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 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 cut a line with a rectangle using the Pathfinder

    I'm a complete newb in artificial intelligence (several years in Ps).

    I'm trying to cut (delete) a rectangular section of a grid which consists of several lines. I get the message, "the filter yielded no results. Please select two paths that intersect. »

    In its simplest form, I have a line of path (a path) and a rectangle filled (also a path). The rectangle is on top of the line.

    image1.gif

    I select both objects and choose less first plan in the Pathfinder palette.

    image2.gif

    And I get the message "the filter yielded no results. Please select two paths that intersect. "I tried all the options in the pane of Pathfinder.

    I want to do is to have the section of the line which is covered by the deleted rectangle, so I'd end up with two lines that looked like this:

    image4.gif

    If the rectangle overlapped the end of the line, I would that the section where they overlap deleted, and I'd end up with a single line.

    I'm sure I'm doing something wrong, but I have watched several videos on the Pathfinder, read a bunch of posts, and I'm still distraught.

    Thank you!

    It is not practical to change the lines into thin rectangles or cleck on each other by using the form builder.

    you don't have click on all of them, select your lines + the rectangle and Alt + click - drag the rectangle (from top down in your example) and everything will be gone at once.

  • How to draw a line in time

    I want to draw a line, so that it looks, it is the transition from one point to another. Basically as it is drawn from point A to point B. I am able to draw a line with ActionScript, but I need to put a little interval in there (maybe 1/2 - 1 second) so that it looks like the line is drawn.

    Does anyone have any suggestions.

    Thank you.

    Dave

    might as well use onEnterFrame, pretty easy if the line is straight, if you're going to angle or curve you will need to use a little math to determine the next point. But for a left right right example of ot, try:

Maybe you are looking for

  • I have additional toolbars unwanted as Add-ons. How can I remove them?

    I have three extra tool bars and search engines. The early with fanatical television, Radio Rage and conservative Talk Now, respectively. How can I remove them?

  • The DC7700 RAM limits

    I have a HP DC7700 with the motherboard 0A54H.  It came with the 1 GB DDR2 PC2-6400(400MHz) memory stick.  I took 2 sticks of memory 1 GB DDR2 PC2-5300(333MHz) on an old PC and seems to work perfectly. I was looking at the specs for the DC7700 and he

  • report table 2D

    I'm doing a summary table in the report, where I can get specific channels, the channel properties values, etc. in a summary table.  So far, I can only displays all of the channels, a single value over and over in a column or property of channel more

  • Win XP (Pro) Service Pack 3 download & install

    Hello My service provider just instyalled Win XP Pro SP2 after uopgrading the hard drive. I couldn't get acesss to the internet because my Connect Manager requires SP3. Do I know if I can download it on another PC, save it using a USB key and install

  • "The product ID you entered is not valid ' CD XP Pro OS.

    It is a new installation on my laptop, using a genuine XP CD. Apparently (I'm told) the key was in the cello-wrap of the package, which has been scrapped. By following some instructions online, I dug down on the CD (using another computer), to /i386/