IDE :: Modify TextField's Margin / Padding?
Jan 28, 2009
When dealing with TextFields, Flash always adds some sort of margin/padding around the outside of your TextField, so that if you set the X and Y of your TextField to 0, then your text would still sit about +4 pixels in.
If you create a TextField and set 'border=true', you will see what i mean - the border is drawn right on the edge of the TextField, but the actual text itself sits within a padding of about 4 pixels.
Is there any way at all to get the text of a TextField to sit hard-up against the border?
View 4 Replies
Similar Posts:
Jan 11, 2011
How can I get a consistent value from the top margin/padding of a TextField to the top of the actual text.According to the docs (link below), the text field has a 2px gutter on all sides. But there seems to be another gutter that seems to increase / decrease with the size of the text.Using times new roman for a default font size, I can get the baseline of some random text using what we know: I know that there is a 2px gutter all the way around the text field and we can get the ascent through textfield.getLineMetrics(0).ascent. If I draw a line at that position I'll get a line about 2 px below the actual text. Works fine.Now if I want to draw another line at the TOP of the text it's a guessing game. At 36pt text it's 8px from the top of the textfield. At 72pt text it's more like 12px from the top, and at 144pt text it's more like 20px from the top.URL...
View 0 Replies
Mar 30, 2012
i created my own Button which simply extends from Sprite.Its able to show 3 different text fading in and out using a timer.In my draw function i first draw a rectangle with the Sprites graphics object representing the background of the button.I added a function to set the button width. This property is used to draw the rectangle. I know that the sprites's size is updated after the rectangle drawing. But for some reason the sprite's width is always more than what i have set via my "setButtonWidth" function.Now i have a simple sprite acting as a button having a graphics.drawRectangle part drawing a simple rect. with lets say 500px width. But when i trace the width of that button it is always about 10% more. Where are these 10% coming from?I read about calling validateNow(). But this is only for Labels, or Checkboxes. For some reason i cannot access the library for Label. This must work somehow with TextFields. But how?
// this function is part of MyButtonClass.as file
function drawButton()
{
[code].....
View 1 Replies
Sep 18, 2010
I'm made an Item class which extends the Sprite class, the Item class basically has a few checkmarks & labels at the moment.
Then what I try to do is run through a for loop of items and create Item classes that I want to place one after each other on the y-axis, so I'm reading the Item.height property to find the y of the next Item in the list.
The problem is for some reason there is always an extra 75 pixels added to the Sprite height at the bottom, no matter how many checkmarks and labels are in each Item class ( varying the height of the Item class ).
Any idea why this is being added and how it can be removed?I'm having trouble figuring this out, I tried dynamicly calculating and setting the Item.height property but when I do that the Sprite is simply cropped.
View 1 Replies
Oct 31, 2011
I am trying to figure out why some letters (like the norwegian Ã… (Ã…)) are cutted out in the middle of the top "o":
My code is this:
var titleFormat:TextFormat = new TextFormat();
titleFormat.size = textSize;
// this is embedded font, and exported for action script, declared
titleFormat.font = myFontBold.fontName;
titleFormat.bold = true;
[Code] .....
So, I have tried different things like setting height hardcoded and bigger than text, but top us cutted again, I have tried with css but no success. Why the letter is not showed fully and why if I zoom in the swf (2-3 zoom ins) it shows up normal (and what i try to achieve) like this: I think it has to do with the topMargin, but unfortunately I didn't find something like that in as3 documentation.
View 1 Replies
Apr 1, 2011
I have a textinput component on my stage with an instance name of "myTxt" I would like to add some left padding to the contents of this textfield. I've tried:
myTxt.setStyle("textPadding", 5); But it adds top (and I assume bottom and right) padding in addition to the left padding. What is the best way to simply add left padding to the textfield's contents?
View 2 Replies
Jan 28, 2009
My first post, yay! Ok, here's what's been bugging me for a long time. When dealing with TextFields, Flash always adds some sort of margin/padding around the outside of your TextField, so that if you set the X and Y of your TextField to 0, then your text would still sit about +4 pixels in.
If you create a TextField and set 'border=true', you will see what i mean - the border is drawn right on the edge of the TextField, but the actual text itself sits within a padding of about 4 pixels.
Is there any way at all to get the text of a TextField to sit hard-up against the border?
View 5 Replies
Nov 10, 2010
I'm trying to apply a padding to the top of my TextField instance in my Flash application, much like you would using CSS.
I haven't found any way to do this. You'd expect it to be a part of the TextFormat or StyleSheet classes, but it's in neither. I sort of found a workaround by adding htmlText to the top of the TextField with <br /><br /> in it, but adding entire lines of white space to the top isn't desirable.
View 1 Replies
Sep 6, 2011
Padding left can be done by TextFormat.leftMargin. And padding right can be done by TextFormat.rightMargin.
But there is no topMargin or bottomMargin property in TextField or TextFormat.
How can I do padding top and bottom?
Example code of left and right padding(margin) of TextField:
var format:TextFormat = new TextFormat
format.leftMargin = 40
format.rightMargin = 40
[Code].....
View 4 Replies
Mar 31, 2011
I have a flash header on my site - nothing crazy, just a short clip. It works in safari and opera on the mac and all IE versions on PC. It will not work properly on firefox on either PC or Mac. Firefox seems to be putting a gap of 10-20px under the flash I have looked up many fixes for this as it seems to be a known problem. I have seen people say it's because the "object" element it treated like letters in FF, so it allows room for the "tails" on a G and Y etc (not sure if I explained that well enough, hopefully you get the idea). I have tried margin:0; padding:0; line-height:0; font-size:0;
float:left; vertical-align:middle; and clear;both; - not at the same time, I have tried many combinations and got most of these ideas from other threads/articles where people had found a solution. I have tried this CSS on an id attached to the object, on the element object and on the parent div - I just can't seem to fix it! Also, as a side note - I've noticed the flash looks good in IE6, IE7 but IE8 makes it looks awful - can anyone explain why or confirm that is what they see? Im a mac user so borrow a laptop to test, it would be good to hear if anyone else see's this problem.
View 1 Replies
Aug 4, 2011
I have an .swf navigation carousel that is 650 pixels high, the bottom 200 pixels being reserved for the reflection of the carousel. The reflection is very subtle and is not considered important information, so we would like to remove vertical scrollbars when the window is high enough to fit the topmost 450 pixels, but not the reflection.
I tried to accomplish this by setting a margin-bottom: -200px to the flash <object> but this only made the container's height shrink 200 pixels, causing the background pattern to cut before the bottom of the page.the Flash itself is still taking up 650 pixels.
Is there some "proper" fix to this, other than hiding/showing the scrollbars actively using javascript?
View 1 Replies
Mar 2, 2010
I've got some text that is crashing my text box border, and I was wondering if there was any way to set a top margin? I saw values for left/right, but nothing that seemed to indicate I could bump the text down a bit...
View 2 Replies
Oct 20, 2009
I am using Flash CS4 at work: newly created type sits flush (top edge) within the text box. If I take the same file home and open in my newly purchased Flash CS4, the text now shows up with 10 or so pixels between the top of the letters and the top edge of the text box (like padding in CSS objects). This is a problem because it means all my text is now positioned lower on the stage than I intended and I can't take projects to and from work and home with any consistency. This is the same font, same file, same program version, which would suggest a preferences setting, but I can't find anywhere to modify text box appearance.
View 4 Replies
Apr 21, 2009
how to remove what appears to be an invisible 20px margin within my actionscript 3 application, written using flex builder. When I add movieclips and set x = 0, they appear about 20px over from the left hand side of the screen. If I set their x = -20, then they appear flush with the left side of the app. Is there any way to get around this/remove this margin?
In the attached picture, the green rectangle is at x = 0, yet it is not flush with the left hand side of the app.
View 1 Replies
Aug 19, 2009
How to set right-margin to whole dynamic text box with external .css file
View 0 Replies
May 12, 2010
Is there a way to add padding between elements in a TileList .
I've passed deadline with a big project , it's all done , but he changed his mind and demands padding. And doesn't want without, i don't have time to make a new component
View 4 Replies
Nov 18, 2010
I am trying to remove all the padding from a Label contained in an HBox. I set paddingTop and paddingBottom to 0 in both the Label and HBox but there is still quite a bit of padding. I also tried setting verticalGap to 0 on HBox. If I just have a checkbox in the HBox the padding is removed fine.
View 2 Replies
Sep 2, 2009
An empty movieClip container will dynamically update it's width and height depending on the sum of it's child objects dimensions. Is there a way to add padding to this value?For example, say you have 10 child displayObjects within a movieclip and all together their width adds up to 100px. Therefore the parent clip's width is 100. Is there anyway to add say 2px padding around these child clips to make the parent clip's width 104? The basic goal here would be to set the parent's width independently and unrelated to it's contents dimensions.
View 7 Replies
Feb 2, 2008
i have a mask which is over some thumbnails. i have given that mask the value ofStage.widthi.e mask_mc._width = Stage.width /1;however i would like the mask to e slightly padded left and right so the mask doesnt go edge to edge of the screen any ideas on how i can do this AS2
View 2 Replies
Jun 6, 2009
i, am building an portfolio site and i have come a long way (still a beginner) but now i found an problem. After i load xml file for paths to portfolio assets i load actual jpg's and/or swf's. But i am stuck since i do not understand how to implement padding so thumbs will be spaced evenly.[code]but than how to position first thumb?
View 3 Replies
Jun 1, 2010
I am working on a time display that takes a time reference from a video. What is the best way to pad the numbers so they show correctly as 00:00, 01:23, etc.Would like to stay away from just padding a string "0" in front, so I can test the var for proper time and use it elsewhere. Has anyone already done this with some code already floating around ?
View 2 Replies
Dec 11, 2009
I have to place a flash movie into an existing layout. It is replacing placeholder image of the same size. The DIV holding the image has a negative top margin. When the flash movie is placed in the same spot there is a gap at the top of the DIV equal to the amount of negative margin. I cannot seem to get the movie to move to the top of the DIV (FF3).
View 1 Replies
Feb 2, 2010
I need to display a word, inside a ractangle with black background, passed to a flash movie through flashvars. Something like: And the rectangle itself should be right aligned to the right margin of the flash movie and 100px from top. I tried two options but in both cases I have problems with defining that different padding inside the rectangle: Option 1:
[Code]...
View 2 Replies
Feb 21, 2011
I have a Spark TextArea with a SpanElement inside. This element has the backgroundColor property set, but I would like to have the background a bit taller because it looks a bit weird at the top like this.[URL]..
I already tried to adjust lineHeight and paddingTop for the SpanElement, but no luck.
View 1 Replies
Jun 21, 2011
Is there anyway for me to adjust the padding (left and right) of the text within a Panel Title in Felx 3.5?
View 1 Replies
Dec 2, 2011
I made a quick search in Google and I couldnt find what I need, basically, I want to set a padding in my combobox component, so the entire combobox (not the items inside) is a little separated from the previous component.
The combobox is contained inside a VBox container, and above there is a label. If I use the padding property, what it does is to decrease the Y position of the text inside, but the component doesn't move at all.
View 2 Replies
Jul 8, 2010
I am using css on flash. Is it possible for me to set different padding for header and paragraph using css. I tried this on external loaded css file, but does not work
[Code]...
View 1 Replies
Feb 23, 2010
I'm planning to provide the visitors of my website an option to toggle between their normal window and an optional fullscreen window. I just don't know how to align a simple movieclip to the left bottom of my fullscreen window (margin 20px). I can't use static parameters because it has to be adjusted to everyone's personal screen resolution. Does anyone know how to fix this?
View 1 Replies
Nov 19, 2009
I have one event handler for several object's events. I would like to pass a value through to the function from the event listener:
PHP Code:
function chkEmpty(event:Event){
if(event.currentTarget.text==""){
thisIsBitIWantToBeAbleChange.text = "You haven't entered anything in the box, please try again"
[Code].....
Could I give the event.currentTarget a value that I could test for? So if the value is 1, I effect output1_txt, if 2, output2_txt, etc etc. If so, are there customisable values that I could use that wouldn't do anything to the display object,?
View 6 Replies
Jun 11, 2010
I'm trying to print a mc which is bigger than the default page size. I want to change the page/margin size so the content can fit in the page without scaling. Per the API reference [URL] the page settings are readonly. How can I print something bigger than the default page size? Is it doable in AS2 or AS3?
View 2 Replies