Actionscript 3 :: Aligning Graphics Line Style Stroke?
Jun 13, 2010
is it possible to align the stroke of a graphic with actionscript? for example, the following code creates a black rounded rect with a grey stroke that is automatically centre aligned.
var t:Sprite = new Sprite();
t.graphics.lineStyle(5, 0x555555);
t.graphics.beginFill(0, 1);
t.graphics.drawRoundRect(25, 25, 200, 75, 25, 25);
t.graphics.endFill();
the lineStyle function doesn't seem to offer any built-in functionality for aligning the stroke. in Adobe Illustrator, you can align a stroke to be either centre (half in/half out of the fill), inside (bordering within the fill) or outside. (bordering outside the fill).
View 1 Replies
Similar Posts:
Feb 3, 2009
Is there a way to draw a line with graphics.lineTo() that is thinner than 1point? According to the documentation the thinnest lineStyle possible should be 0 but I cannot see any difference between a 0 stroke and a 1 stroke?
View 4 Replies
Oct 5, 2010
My paint brush tool seems to be locked. I can't change the stroke, style, or scale....?
View 1 Replies
May 29, 2009
In Flash CS4, I'm trying to change the stroke width of my line or shape, with it selected, but the stroke width slider is greyed out (thus, unadjustable). Is it possible to edit a stroke width after something has been created? If so, how can this be done? I've tried selecting the line in all kinds of crazy ways, but still can't edit it.
View 3 Replies
Aug 15, 2011
Under the stroke properties before or after I draw a line, I set it to NORMAL but when I re-select the line, it keeps changing it back to NONE. Some how it is now the default and I cannot change it I have tried opening new documents from scratch but I still cannot get it back to scale normally. All the lines are inside movie clips and these movie clips need to scale properly. I cannot seem to find any other answers besides telling me what I have already tried.If I change the line type from solid to dotted, it then scales (actually you cannot change the scale mode.
View 1 Replies
Sep 17, 2009
using pencil tool inside flash i can create stippled line style, well, im using graphics.lineTo(mouseX, mouseY) to create a drawing API but i need use some in this line a style like stippled stroke, or if is possible use stroke ( and how ) to make the same line using stippled style?
How to custom this line?
View 5 Replies
Feb 2, 2011
So I was messing around with JSFL, and I wanted to set the storke to None. That should be done like this:
var stroke = fl.getDocumentDOM().getCustomStroke("toolbar");
stroke.style = "noStroke";
fl.getDocumentDOM().setCustomStroke(stroke);
[Code].....
I get a solid storke with aRGB value: 00 00 00 00 (0 alpha, 0 red, 0 green, 0 blue). (Which normally is impossible using the color-toolbar)
If I execute that command once more, I get the right stroke color! (It also works if I have any normal solid color. If the stroke is a gradient or bitmap, nothing happens).
As I mentioned, there have been NO problems at all with setting things for fills. ONLY strokes.
View 1 Replies
Mar 28, 2009
Is there a way in as3 to manually call one of the preset line stroke styles? I need to call one of the stroke styles given in the pull down menu (6th down actually) in the line drawing tool. I.E. I'd like to be able to draw the exact same line via manual calls in as3 that I can draw with the line took in the GUI.
View 1 Replies
Feb 28, 2012
I'm drawing a line using this code:
this.graphics.moveTo(posx, posy);
this.graphics.lineTo(2*posx,2*posy);
But now I want to remove it, but I can't clear the whole this.graphics object because it contains more information that is useful for me. How can I remove this line without clearing this.graphics object? Is there any method to draw a similar line over it to hide or replace the line?
View 2 Replies
Sep 28, 2010
If I skin a button and use the AS3 graphice.clear() and graphics.lineTo and beginFill to create a shape, the button overlaps other items in the container.
When I use the and mxml to create the same shape, the button is neatly positioned inside the container.
View 2 Replies
Apr 4, 2011
I wanted to check if there is a easy way to build an arrow for a line... currently I am trying to draw a triangle at end of the line- doable but a load of geometry to handle as the line could be at any angle and- anything build-in available?
View 3 Replies
Feb 17, 2012
How can I set a line-through style for a s:label like css text-decoration:line-through.
View 1 Replies
Mar 2, 2009
Is there a way to create a custom line style - a pattern line.
I'd like to use my movie clip object to repeat across a line, like a dotted line, just that a dot will be replaced with my movie clip.
View 1 Replies
Apr 6, 2004
This is my scenario: I have a pencil that uses the simple drawing feature. When the mouse is pressed and dragged, the pencil draws a line. Basic stuff. What i want to do is have the line be a 'graphite' type of color, instead of the boring black, red etc. I'm thinking that i would use a mask with the graphite color layer on the bottom, and a blank white layer on top, then when the line is drawn, the pencil is actually erasing the top layer, to reveal the bottom graphite layer.
View 14 Replies
Apr 6, 2004
This is my scenario: I have a pencil that uses the simple drawing feature. When the mouse is pressed and dragged, the pencil draws a line. Basic stuff. What i want to do is have the line be a 'graphite' type of color, instead of the boring black, red etc. I'm thinking that i would use a mask with the graphite color layer on the bottom, and a blank white layer on top, then when the line is drawn, the pencil is actually erasing the top layer, to reveal the bottom graphite layer. This seems somewhat farfetched.
What would be the best approach at achieving this 'graphite'-style line fill?
View 14 Replies
Jan 20, 2010
How can I Tween drawing a line mc.graphics.lineTo(); ? I just see tweener has an onUpdate property awesome.
View 0 Replies
Mar 7, 2011
I have an application that creates a chart dynamically. This chart has a lot of information plotted on it (4-6 stock trends). I want to be able to toggle some of those lines with a button. Each trend is drawn with something like this:
Code:
// establish a new Vector object for the commands parameter
var line_commands:Vector.<int> = new Vector.<int>();
line_commands.push(1,2,2,2);
// establish a new Vector object for the data parameter
var line_coord:Vector.<Number> = new Vector.<Number>();
// use the Vector array push() method to add a set of coordinate pairs
line_coord.push(0,0, 75,50, 100,0, 125,50);
graphics.drawPath(line_commands, line_coord);
How would I toggle the line I just drew? My first idea would be to put some of this code inside a function and redraw the line with the same color of the movie's background color. I don't know if this is the best option, I was wondering if I could draw this line inside a Sprite or Movie Clip and just toggle its visibility?
View 2 Replies
Jun 14, 2010
How can I create a rounded rectangle with a dashed line? I've seen several routines that draw their own straight lines, but nothing for rounded rectangles.
View 2 Replies
May 15, 2009
I am trying to draw a line from x1, y1 to x2,y2 and i want it to be a line that repeats a pattern from an image. All I can see is that you can only draw lines and change their color or thickness but I would like it to repeat an image. Is that possible or do i have to use a really long and thin rectangle with a bitmap fill?The problem is I am making a game where the user will be able to actually draw the line so i have to make it be created dynamically. The game fantastic contraption [URL] has in the game a feature where you draw lines of any length and position that are filed with a picture.
View 13 Replies
Oct 21, 2010
I have a Flex Column Chart that has a range of 0 - 6 on the y-axis. I have added the following block to change the default colour of the horizontal grid lines to black.
<mx:backgroundElements>
<mx:GridLines>
<mx:horizontalStroke>
[Code]....
This works fine for all but the horizontal grid line at the top of the chart (at y=6). If I change the maximum value for the y-axis to something different then this new max doesn't have the formatting applied (but all the others do).
how do I get the top line to be black like the rest of the grid lines?
View 1 Replies
Apr 13, 2012
I am trying to delete a single line using graphics.clear() method but it clears all the instance of lines created by lineTo() method. I want to remove a single line upon click from bunch of its multiple instance.
View 2 Replies
Apr 9, 2005
I was wondering about MC and hey can help to lag a game out. I set up an advanced class system so i don't have to use MC to simulate walls, all i use isthe x,y,width and height. Well anyway since i don't need MC anymore I was wondering if there is a way to attach Graphics instead of MC cause a Graphics file size is relatively small than that of a graphic, I think. If anyone could tell me thats true and show me a way to attach graphics that would be nice. I haven't tried it yet but maybe if I exported the graphic from the library imihgt be able to call its name, but it doesn't have an instance name so im stuck.
View 2 Replies
Oct 8, 2009
i am trying to receive in my function as a parameter either a shape or a sprite and then access their graphics property, but this gives me an error:
Code:
public static function makeRect( obj:DisplayObject, ...
var g:Graphics;
if(obj is Sprite){
[code]...
//1119: Access of possibly undefined property graphics through a reference with static type flash.display:Graphics.
View 1 Replies
Oct 23, 2009
I've got a comboBox component on the stage, instance name 'combo'. I want to style the text. I followed the adobe instructions, but they seem not work, and I get no errors.
Code:
import fl.data.DataProvider;
import flash.text.TextFormat;
var tf:TextFormat = new TextFormat();
[code].....
View 2 Replies
Dec 17, 2009
i have an xml file and i want my code in flash to read it line by line but its only showing the first line out of 5 lines.Below is the code:
var NigeriaNumber:Number;
var stateName:String;
var year:String;
[code].....
View 0 Replies
Apr 6, 2009
I want to align some text to a path but I want it so that the each letter in the text follows the path and goes around curves and stuff. I don't just want a block of text following the path. This is what I am getting no
View 3 Replies
Dec 8, 2010
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Canvas width="100%" height="100%">
<mx:Canvas backgroundColor="#A8A8A8" height="100%" right="0" top="0" width="100">
</mx:Canvas>
[Code]...
My code above works absolutely fine, until i resize my browser window to a size below 800px width. When the browser window is make of lesser width than 800px, the canvas with background color #A8A8A8 is on the right of the window, but the problem is, when I move the scroll bar, the canvas should remain on the right of the window. Which does not happen, and that is what my problem is.
How can I solve this issue. What should I do to keep my canvas be on the right=0 all the time.
View 1 Replies
Apr 28, 2009
I'm just trying to load a videostream, align in the center of the stage and put it on the first visible layer.This code just loads it but align it on top-left of stage and under some layers that forbid it to be seen.[code]
View 5 Replies
Feb 6, 2010
I just migrated from CS3 to CS4 I have a set of navigation buttons which are in text now. I need the first left word to be at 100 align left and the last text word to be at 800 align right there are 3 other buttons in the middle. How in the world do I align all these with keeping the far left word and far right words where against their lines and keeping the spacing inbetween all the same? I tried this with keeping the text as text and using the align tools, paragraph tools then converting all the text to an mc and still can't get it right. I pic of what I need to do is in the attached.
View 3 Replies
Mar 15, 2010
I'm working on a flash piece with buttons that display images when you rollover them. When I publish the fla the thin lines are blurry and look out of alignment even though they are perfectly aligned when I zoom in on the fla.
View 2 Replies