Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Horizontal Spacing And Dynamic Text Fields: Possible?



The problem I have is that I just cant seem to work out how to have kerning or horizontal spacing on dynamic letters or numbers in dynamic text fields. I would like to know if its possible or not. If it is then i'll drop my workarounds below and just do what ever it i need to get it working.I worked out a workaround for the loadVars problem by placing a space between all the letters in the text file!Im now stuck with the preloader..I know what im trying to do is possible, but im not sure where to start so I need some help.This is the preloader:startListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number){percentage = Math.round(bytesLoaded/bytesTotal*100);//the if/else ensures it always produces a 3 digit numberif (percentage==100) {loader.text = percentage;//if the percentage is under 10, then stick 00 in front}else if (percentage<10){loader.text = "00"+percentage;//if the percentage is between 9 and 99 then stick 0 in front} else {loader.text = "0"+percentage;}}I need to space out each individual digit of the percentage. Im thinking this must be possible with alittle algerbra and actionscript. Any ideas?Thanks in advance,Hoolagonwww.kigwan.com



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 05-03-2007, 07:45 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Horizontal Spacing And Dynamic Text Fields: Possible?
The problem I have is that I just cant seem to work out how to have kerning or horizontal spacing on dynamic letters or numbers in dynamic text fields.
I would like to know if its possible or not. If it is then i'll drop my workarounds below and just do what ever it i need to get it working.

I worked out a workaround for the loadVars problem by placing a space between all the letters in the text file!

Im now stuck with the preloader..I know what im trying to do is possible, but im not sure where to start so I need some help.
This is the preloader:

startListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number){
percentage = Math.round(bytesLoaded/bytesTotal*100);

//the if/else ensures it always produces a 3 digit number
if (percentage==100) {
loader.text = percentage;
//if the percentage is under 10, then stick 00 in front
}else if (percentage<10){
loader.text = "00"+percentage;
//if the percentage is between 9 and 99 then stick 0 in front
} else {
loader.text = "0"+percentage;
}

}

I need to space out each individual digit of the percentage. Im thinking this must be possible with alittle algerbra and actionscript.

Any ideas?

Thanks in advance,

Hoolagon

www.kigwan.com

Horizontal Spacing With Dynamic Text Boxes
Hi,

Using the tutorial for the Digital Clock I have created my own date viewer.

However, because the text boxes are dynamic, I cannot edit the horizontal spacing of the font.

I wish my date to look like the image below but as I cannot edit the horizonatal spacing, I cannot squeeze the letters together.



Is there another way of doing this?

Thanks in advance.

Horizontal Spacing With Dynamic Text Boxes
Hi,

Using the tutorial for the Digital Clock I have created my own date viewer.

However, because the text boxes are dynamic, I cannot edit the horizontal spacing of the font.

I wish my date to look like the image below but as I cannot edit the horizonatal spacing, I cannot squeeze the letters together.



Is there another way of doing this?

Thanks in advance.

Character Spacing In Dynamic Text Fields
Hi All,
How can i give character spacing in dynamic text field using Actionscript?
I have tried:

x_txt.htmlText="<span style='letter-spacing:2.0pt'>My Text</span>"

I Suppose, this is not working because span tag is not supported by Flash MX.

Can anyone provide me with a solution?

Thanks,
Aman.

Letter Spacing In Dynamic Text Fields
Hello,

When I load text into a dynamic text field it loses its letter spacing. I type in some text in Flash and set the letter spacing and all is fine, but when I run the swf the spacing is reset to 0. I've tried setting it using actionscript but that doesn't work. Any ideas?

Line Spacing In Dynamic Text Fields
Having some difficulty setting line spacing attributes in a dynamically created text field (i.e. using createTextField().

Is there an actionscript equivalent to setting line spacing in the paragraph options of a normal textfield? Can't see anything in text format.

Cheers,

jJ.

[Flash8] Dynamic Text Fields / XML / Spacing
So I have a project where there are 5 dynamic text fields, and I thought it would be quite simple. Create a dynamic text field, and then load in the .xml content, and I had it complete. However, it turns out that spacing is quite important, so my method will not work, and I'm kind of stumped how to proceed. Here is a visual representation of how it is layed out:



So the things highlighted in red represent the .xml nodes, and as the width (character count) of TEAM1 and TEAM2 change, the spacing needs to remain consistant, and the static elements (the "vs." and "|" need to move accordingly, and the TEAMLOCATIONS need to stay lined up as well...

Does anyone have a good idea how to handle this, or a good tutorial they could point out? I'm trying to build my own array structure, and calculate the width of "TEAM1", but it's slow going... Any ideas would be greatly appreciated.

Thanks!

-EmoJoy

Letter Spacing In Dynamic Text Fields
Hi Guys,

The title give it away really:

Is it possible to increase letter spacing within dynamic text fields. I feel a bit of a dumbass asking this but never really had to play with them before, it's just the font that has been supplied looks aweful with a 'zero' setting.

Any advice, thanks in advance.

Phil.

[F8] Control Letter Spacing In Dynamic Text Fields
This guy found a solution for a poorly-documented problem:

http://bobspace.wordpress.com/2006/0...letterspacing/

Horizontal Spacing Between The Text In The Ticker
I am facing a problem with the horizontal spacing between the text in my scrolling ticker.The text is loaded from a
.txt file.

Is there any way whereby this spacing can be controlled.

Horizontal Spacing Ondymaic Text
Can you set the horizontal line spacing on dynamic text ie text created via createTextField()?

Dynamically Generated Text Fields - Height/Spacing
Could some kind soul point me in the right direction - I know I must be missing something simple -

- I am generating a list of clips in a scrollPane, each clip displays some text via an array which has extracted the data from a loaded XML file, so far so good, my problem is I cannot seem to generate the right code that records the _height of the previous clip and then asigns the new clips _y axis based on that value - at the moment I have a static value, var spacing - which I'd like to be fluid based on how high the prev text field was, in order that each of the clips display their text in full - have tried various variables such as newY = (this.post_mc._height * 20) but no joy. Would someone mind clearing the air for me please?! been going great guns so far for a simple designer but this bit has me stumped


Here's my code;


ActionScript Code:
function makeThread(posts, userPost, userID, maxPosts){
threadList_sp.vScrollPolicy = "off";
var spacing:Number = 100;
// Loop through each post
    var name_str:String = "post" + (posts) + "_mc";
    var depth:Number = posts * 10;
// Create post clip
    var post_mc:MovieClip = threadList_sp.content.attachMovie("post_mc", name_str, depth);
// Format clip
    post_mc._y = (posts * spacing);
    post_mc.userName_txt.text = "Posted by " + (userID);
    post_mc.userName_txt.autoSize = "left";
    post_mc.userPost_txt.text = userPost;
    post_mc.userPost_txt.autoSize = "left";
// Check if this is the last clip
    if((posts + 1) == maxPosts){
        //trace("function Fired");
        threadList_sp.vScrollPolicy = "on";
    }
}
function init(){
    var threadArray:Array = new Array();
    //Loop through each post
    for(var posts:Number = 0; posts < this.firstChild.childNodes.length; posts++){
    threadArray[posts] = new Object();
    threadArray[posts].userID = this.firstChild.childNodes[posts].attributes.userID;
    threadArray[posts].postDate = this.firstChild.childNodes[posts].attributes.postDate;
    threadArray[posts].userPost = this.firstChild.childNodes[posts].childNodes[0];
    //trace(this.firstChild.childNodes.length);
    //trace(userID);
    //trace(maxPosts);
    //trace(userPost);
    trace(posts);
    var maxPosts:Number = this.firstChild.childNodes.length;
    var userID:String = threadArray[posts].userID;
    var postDate:String = threadArray[posts].postDate;
    var userPost:String = threadArray[posts].userPost;
    makeThread(posts, userPost, userID, maxPosts);
    }
}
var threadListXML:XML = new XML();
threadListXML.ignoreWhite = true;
threadListXML.onLoad = init;
threadListXML.load("threadlist.xml")

Changing Text Spacing On Input Text Fields
It appears to me that the text spacing tool ( AV ) in the properties inspector does not work on input text fields. All other tools do seem to work though.

I'm creating a form to be used by a classroom instructor to show students how each of the 200+ input text fields should be filled in. The months, days and years are individual cells. Currently, for the date cells, you must click on each cell, type in the number, click on the next cell, type in the number, etc. It would be nice to avoud the mouse click between theses inputs.

What I would like to do is spread out an input text field that will accept 4 characters (for the year). The character spacing is needed to align the characters up with the graphical input blocks.

Any ideas?


Thanks for helping.

Horizontal Moving Text Fields
I wanna create horizontal moving text fields like those cheesy javascript ones. The only catch is that i want to load variables into those fields from an external txt. file. can this be done with action script?

How To Specify Character Horizontal Spacing With AS?
Hi.

I've been searching around, trying to find a way to give a textfield a horizontal spacing using actionscript ... but had no luck.

Anyone knows how to do it?

Thanks,

flashbot.

Dynamic Text Spacing
Hi

When I enter text into my html form and then pass the text to my dynamic text field in my flash program, all the text seems to be double spaced or has extra returns in them. Is there a setting that correct this?

Dynamic Text Spacing?
is there a way to space dynamic text?

through actionscript?

the letters of my dynamic text are to dense and i would like to change this.


regards,
.dnd

Equal Spacing For Horizontal Navigation
I am building a horizontal navigation and I am having trouble getting equal spacing between the mc's. Inside the mc's there is a text box that will contain different titles.


Code:
function buildNav():Void
{
var navTitle:Array = new Array({title: "home", path: "index.html"},
{title: "tools", path: "tools.html"},
{title: "specs", path: "specs.html"},
{title: "process", path: "process.html"},
{title: "reference", path: "reference.html"},
{title: "best practices", path: "practices.html"});

var navHolder:MovieClip = r.createEmptyMovieClip("navHolder", 0);

var tempX:Number;

for(var i:Number = 0; i < navTitle.length; i++)
{
var mc:MovieClip = navHolder.attachMovie("nav_mc", "nav_mc" + i, i, {_x: tempX});
mc.id = i;

tempX = ((mc._x + mc._width) + 60);

var navFormat:TextFormat = new TextFormat();
navFormat.leftMargin = 10;
navFormat.rightMargin = 10;

mc.nav_content.nav_content_txt.autoSize = true;
mc.nav_content.nav_content_txt.text = navTitle[i].title.toUpperCase();

mc.nav_content.nav_content_txt.setTextFormat(navFormat);

mc.nav_hit._width = mc.nav_content._width;

mc._y = 6;
}
}

Text Rendering Bugs W/dynamic/css Text - Overlaps, Spacing, Etc.
Hi There:

This is a problem I've been having for years but which came up again today. I've got a fairly complex quiz engine which builds question and answer screens from xml & stylesheets using embedded fonts. I've wrangled most of the basic issues with formatting - bold & italics, special characters, etc.

Unfortunately, I still have regular problems with Flash's rendering of the text - usually when using an inline style with italics. At small font sizes italic text will overlap the text that precedes it - and I know that it's a rendering bug, because if I zoom in to 200 or 400%, the letter spacing is correct. I end up adding non-breaking spaces to the file, which is bad form, but it works.

Today I have a problem with underline tags adding too much space between words - even when there are no spaces. Again, it displays correctly when zoomed in. Unfortunately, I can't fix this one by adding NBSPs. I've tried playing with the letterspacing with no success.

Does anybody have any insights or advice? I'm attaching an image that shows examples of what I'm talking about. I've experienced this problem for YEARS with dozens of different fonts, and I've tried every variation of kerning/letterspacing/font embedding etc. that I can think of.

Thanks in advance!
Patrick

Text Rendering Bugs W/dynamic/css Text - Overlaps, Spacing, Etc.
Hi There:

This is a problem I've been having for years but which came up again today. I've got a fairly complex quiz engine which builds question and answer screens from xml & stylesheets using embedded fonts. I've wrangled most of the basic issues with formatting - bold & italics, special characters, etc.

Unfortunately, I still have regular problems with Flash's rendering of the text - usually when using an inline style with italics. At small font sizes italic text will overlap the text that precedes it - and I know that it's a rendering bug, because if I zoom in to 200 or 400%, the letter spacing is correct. I end up adding non-breaking spaces to the file, which is bad form, but it works.

Today I have a problem with underline tags adding too much space between words - even when there are no spaces. Again, it displays correctly when zoomed in. Unfortunately, I can't fix this one by adding NBSPs. I've tried playing with the letterspacing with no success.

Does anybody have any insights or advice? Here's an image that shows examples of what I'm talking about. I've experienced this problem for YEARS with dozens of different fonts, and I've tried every variation of kerning/letterspacing/font embedding etc. that I can think of.

Thanks in advance!
Patrick

Set Dynamic Text Letter Spacing ?
Hello I am wondering if there is any way to be able to set the letter spacing for dynamic text like you can with static text? I know I could break each word up into an array and insert spaces in between each letter and feed it back into a string, or something like that, but that seems like a lot of trouble... is there any other way?

thanks in advance for any ideas!

Dynamic Text Line Spacing
im loading text into a multiline text area from .txt file

why in text file if i start a new line does it show up in flash as a huge gap? (<p>)

how can i display text file "as is"????

Dynamic Text Line Spacing
Hello--

This is the code i use 2 upload my text file

Code:
loadVariablesNum("screen.txt", 0);


Inside the TXT file i wrote

Code:
screen=bla bla


so far so good

BUT!
When i write two sentences like:
Hello world,
How u doing?

In the SWF it shows like
Hello world,

How u doing?

I dont know y it makes an extra space?
How can i fix this?

Thanks allot,

Dynamic Text And Character Spacing
Hi there,

Is it all possible to reduce the character spacing in dynamic text? I have some dynamic text fields displaying the date etc and the letter spacing needs to be tighter. Any ideas?

Thanx

Dynamic Text Character Spacing
I am not sure how to control the character spacing when a text box is dynamic. Has anyone found how to make this work?

Thanks so much!

Brian.

Dynamic Text Character Spacing
I am not sure how to control the character spacing when a text box is dynamic. Has anyone found how to make this work?

Thanks so much!

Brian.

Character Spacing In Dynamic Text
Is there a way to use character spacing in dynamic text? You can use it with static text it's an option drop down on the properties dialog box, but I can't find a way to use it with dynamic text.

If there is for some very stupid reason you can't is there a way around it.

Thanks

Character Spacing For Dynamic Text
Hi,

is there a way to specify the character spacing for dynamic text ?
thx

Charachter Spacing Dynamic Text
Hi anyone know how to set the character spacing of dynamic text.

[CS3] Dynamic Text Line Spacing
I have a dynamic text tat loads a txt file.
it is multiline and HTML.

it loads the original file (like this):

this is a test message
this is a test message
this is a text message


like this:


this is a text message



this is a text message



this is a text message



the problem is.... to much line spacing, and different than the original.
How can I correct this ?

Thank you.

Flash Dynamic Text Spacing
Hi,

I have a website iin Aspx 2.0 that loads some data from an Access Database to Flash Dynamic Text boxes.
My problem is that in my server Flash in not "loading" the paragraph information, when there is more than one paragraph. I tried the same website in another server and it doubles every paragraph. I don't know why. Everything is exactly the same...
Here are pictures os the same text in the two different servers:

http://pwp.netcabo.pt/jn.brochado/server1.jpg
http://pwp.netcabo.pt/jn.brochado/server2.jpg

Any ideas why and how to solve it???
thanks..

Dynamic Text Letter Spacing?
i notice for flash 8. static text'S letter spacing can be controlled by actionscript BUT I have no luck doing the same with dynamic text.
take a look at my source file. and see if you got better luck with letter spacing with dynamic text.

raskol

Dynamic Text, Multiline, Spacing?
Hello all!

I am working on a project that loads an RSS feed into a dynamic text box. I have the feed loading just fine, but once it loads the spacing between the "wrapped" lines is HUGE compared to the spacing between topics.

Here is an example:
example HERE

Is there any setting in Flash 8 that I can use to correct this? Actionscript maybe?

This looks dumb, and it's driving me nuts.

Thanks,

Chris

Dynamic/Input Text Spacing
Is it possible to have character spacing in an input field and a dynamic textbox? If so, how do I do it?

the font i want needs to be spaced

Thanks

Letter Spacing On A Dynamic Text Box
I would like to apply letter spacing on a dynamic text box, but it seems once I export the swf, the letter spacing defaults back to 0. How can this be done?

Thanks a lot for any help!

Letter Spacing For Dynamic Text
Hi All,

Im having a problem with setting the letter spacing for a dynamic text box that exists on my timeline.

I have a string which is telling the dynamic text box what words to put into it.

What I want to do is set the letter spacing to 5. I have tried the following code from the help manual: -

var format1:TextFormat = new TextFormat();
format1.letterSpacing = 5;
myTxtBox.setTextFormat(format1);

What this does is sets the leading to 5 for any text I physically write into the box, and then preview. For any text that I dynamically load using a string and preview..... the leading is 0?

Any ideas? Help is thanked in advanced

Line Spacing W/ Dynamic Text
Hey guys, I have a question about line spacing and dynamic text. For my client site, www.haultrash.com ,a line break is double spaced. I didn't use HTML, and this is exactly what the Shop Haultrash text file looks like:

shop=HaulTrash.com now has an online store to buy all kinds of HaulTrash merchandise! At the store, you will find:

-T-Shirts
-Sweatshirts
-Collared Shirts
-Baby Accessories
-Boxers
-Hats
-Mugs
-Tote Bags
-And Much More!

If you go to the shop section on the site however, whenever there is a line break it is double spaced. To add to the problem, it works fine on my own server, as you can see if you go to

http://www.someoneleet.com/main.html

The .swf, .html files and .txt files are the exact same on both sites. What could be making the text act like this? Is there a double line break in Flash or something you can customize?

Maybe you guys know something I don't because I'm stump[ed, and as far as I know, the server should ot have anything to do with the text.

Thanks!
-brad-

Spacing Dynamic/input Text
Is it possible? I want to space out the characters so they arent so clumped in input and dynamic text

s e n d

instead of

send

thanks

Letter Spacing In Dynamic Text
I want to increase the letter spacing of dynamic text that I am using is it posible...mine doesn't allow me to do this.

Thanks in Advance.
Noir.

Spacing Of Dynamic Text Field.
Normally I would space the mc's on a whole number like for thumbnails, but since the widht is set to autosize, I cant do that. Help please.

ActionScript Code:
var showWhat = 0;var links:XML = new XML();links.ignoreWhite = true;links.onLoad = function(ok) {    if (ok) {        var entrys = this.firstChild.childNodes;        for (var i = 0; i<entrys.length; i++) {            var current = entrys[i];            var secret = current.childNodes[0].firstChild.toString();            if (secret == showWhat) {                var titleBtn = menu_mc.attachMovie("title_txt", "button"+i, i);                titleBtn.titleTxt.autoSize = true;                titleBtn.titleTxt.text = current.childNodes[1].firstChild.toString();                // need help with this line                titleBtn._x =                 ////                titleBtn.entry = current.childNodes[2].firstChild.toString();                titleBtn.date = current.childNodes[3].firstChild.toString();                titleBtn.link = current.childNodes[4].firstChild.toString();                titleBtn.img = current.childNodes[5].firstChild.toString();                titleBtn.onRelease = function() {                    trace(this.entry);                    trace(this.date);                    trace(this.link);                    trace(this.img);                };            }        }    }};links.load('http://www.xml.xml');

Spacing Of Dynamic Text Boxes
I am having trouble spacing dynamic text boxes with as.

I can define how many spaces(characters) for each text box, but I want it to say something along the lines of:


"mc._x = i._width + "some extra space";

here's where the problem is:



ActionScript Code:
spacing = 150;boot = function () {    for (var i = 0; i<images.length; i++) {        mc = container.attachMovie("thumbMC", "thumb"+i, i);        trace(mc);        //mc._x = i*(spacing);        mc._x = thumb[i].width;        mc.path = images[i].path;        mc.link = images[i].link;        mc.over.captionMC.caption.text = images[i].caption;    }




I just don't know how to say mc._x = i._width + spacing; in flash. If anyone could help I'd really appreciate it. I'm working on this as I type this so hopefully I can figure it out myself, but I'm not the greatest as-er

thank you.

Letter Spacing On A Dynamic Text Box
I would like to apply letter spacing on a dynamic text box, but it seems once I export the swf, the letter spacing defaults back to 0. How can this be done?

Thanks a lot for any help!

Spacing Dynamic Text Widths
Hi there,

I would like to determine the exact spacing of the textfields for my xml file so I get a result for my horizontal nave like: home/ features/ work/ etc.

Now I have something like this:

GenerateMenu = function (container, name, x, y, depth, node_xml) {
var curr_node;
var curr_item;
var curr_menu = _root.container;

for (var i = 0; i<node_xml.childNodes.length; i++) {
curr_item = curr_menu.attachMovie("beh", "item"+i+"_mc", i);
curr_item._x = x+i*spacing;
curr_item.i = i;
curr_item._y = y;
//beh(export name) is the movieclip attached to the mc container. In the mc with export name "beh' I have a textfield with the name 'name'.

This is what I tried to create the space with no result:
container.beh.name.autoSize = true;
spacing=container.beh.name._width +10;

Can someone help me out. Thx

Spacing Dynamic/input Text
Is it possible? I want to space out the characters so they arent so clumped in input and dynamic text

s e n d

instead of

send

thanks

Character Spacing For Dynamic Text
Hi,

is there a way to specify the character spacing for dynamic text ?
thx (and HELPPPP !!)

Dynamic Text Box Character Spacing
hey.

Im loading external .txt files into dynamic text boxes in flashMX.

Is there a way to alter the character spacing in either flash or the txt file though as it screws my design up greatly without it?

thanks




cuse

Vertical And Horizontal Thumbnail Spacing - .as Related
in this file i have 7 thumbnails. 5 out of 7 are 93x66 pixels, but the other two are 66x93 pixels. when i test the .swf, there is a large space after the two vertical thumbnails, and i don't know how to change it. i think it would be easier to view the file in question here, which is labeled print.fla. the .as file that contains all the code is called Thumbnail.as.

I just want to reduce the spacing after the vertical thumbnails to 10 pixels, but if i change this in the code, then it screws up the positioning for the horizontal ones.

thanks in advance.

Better Control Over Line Spacing With Dynamic Text
I'm putting together an administration system for my boss that will allow him to update his Flash-based site simply by editing content from an HTML textarea. The system works perfectly and is totally dummy proof. My only problem is with line spacing.

To my knowledge, when a dynamic text field is set to render HTML tags, it inserts a &ltP&gt tag for each line break. That means that for each new line entered in the HTML textarea there will be a new paragraph. This makes sense as when else would you put a line break? The problem however is the spacing or line height of the &ltP&gt effect. I've played with the formatting of my dynamic text field but reducing the line spacing to a comfortable paragraph spacing results in other lines of text overlapping each other.

I've tried replacing chr(13)'s (via PHP) in my HTML textarea with &ltBR&gt, escaping the HTML tag to avoid simply rendering it. The problem here is that MySQL takes this literally. So when my SWF retrieves this data, it sees it also as a literal (i.e. &ampltBR&ampgt instead of &ltBR&gt) and doesn't render proper &ltBR&gt tags.

Something tells me the HTML renderer is of fairly poor quality. Something else we should ask Macromedia to fix in future releases.

I'm at work and can't spend much time on this so I appologize for any clarifications that may be needed.

-ptolemy
[Edited by pateym on 07-09-2002 at 12:28 PM]

Character Spacing In Dynamic Text Boxes
er, what the title says really

i need to fix the character spacing on some dynamic text, is there a way to do this???

Maybe there is a way to do it outside of flash???

thanks



cuse

Copyright © 2005-08 www.BigResource.com, All rights reserved