dynamic text box character spacing


#1

hi…

just a quickie, wondered if anyone knew how i can change the character spacing on a dynamic text box in flash mx?

i have an external text file that loads txt into the dynamic text box but the ‘render for web’ button has to be off as i want to preserve the font.

Anyway, dynamic text takes away the option for character spacing, anyone know if there’s a work around? shame i cant set an expression like .txtColour

thanks(sorry if its a ramble:))

cuse


#2

Don’t kill me if I’m wrong, but you can only have character spacing if you render the text as html. My advice: Load the text from an xml-file in html format…it gives you close to total control of dynamic textfields.

Good luck


#3

SdFX, do you have a good reference for that? i’ve tried a few different things and had mixed results, i’m actually playing with a site now where i’m trying to load html content (just text and links) into a scrollable text box and having some probs. thanks.

chris


#4

actually, i dont think you can even have character spacing in render as html option…

would like to use your way but i have no experience in xml and if there’s a tutorial or something you can point me to , great. But i need to show the update to a client next week so there isnt much space for testing.

thanks

cuse


#5

…hmm. Maybe I was a tad too fast about character spacing in MX…I’ll try to look into it and post here, if I find a solution. About html-text and xml, It’s pretty straight-forward…I’ve just finished the viewer-portion of a dynamic news section at www.specialdeffects.com …as for tutorials, I remember there’s a good intro to xml on www.ultrashock.com…I can find you some direct links if you’re interested.

The only thing to really watch out for is how to handle embedded fonts - that can get a bit hairy.

S


#6

hey thanks, for the client preview i think ill just have to stick to loading a .txt file and explain were working on character spacing, its only a bonus feature for them anyway but it would be nice to have more perfected.

ill see what i can dig up but if you find anything else please let me know… :thumbsup:

cuse


#7

Damnit…the only way to do character spacing is by inserting non-breaking spaces or doing a similar annoying work-around. If you have a look at the TextFormat (object) in the action script reference it’s pretty obvious what you can and can’t do with dynamic textfields. I have to think first and shoot later in the future… :slight_smile:

Good luck with your client!


#8

I think that the only way that you will be able to do this is to break apart your text and place them a certain distance from each other as seperate movie clips. Take a look at my little experiment. Pay close attention to how I set the distance between the characters: TextEffects

NOTE: Take the code appart and get rid of the animation.


#9

mohh im not sure if you read the whole post, the text is being called from a .txt file. how would i break it apart?

cuse


#10

Actually, you could break it apart by creating textfields on the fly containing only a single character each…but IMHO it’s way too bothersome unless you’re doing a simple text effect like the one shown.

S

Edit: …and that’s exactly what MOHH did :slight_smile:


#11

good stuff, thanks guys.

chris


#12

cuse,

Did you look at the example that I provided? The text is being pulled from a text file… :shrug:


#13

mohh, sorry i didnt get the chance, client has rescheduled anyway so gives me some room to experiment.

ill have a look today thank you for supplying it though…

cuse


#14

mohh,

It’s pretty cool, but remember that character spacing can be a royal pain if you’re not using a monospaced font. For instance, the distance between A & V is very different from the distance between M & M…

S


#15

Hey SdFX,

That’s true, but if you look at the example, you will see that it takes care of that problem. Each new movieclips width is taken into consideration and then placed the specified distance from the last one.

cuse, its ok man. I know how those days can be.


#16

mohh,

Your approach can take you far, that’s true - but in a font file, every single character has a lot more spacing information, than merely it’s width. In the case of A & V they’re actually overlapping…see attached image. The font you have used is very easy to handle compared to others. :slight_smile:


#17

That’s true.

I’ve updated the file with a more common font so that it can be a little more clear. I’ve also added a distance variable so that you can control the distance between each charachter. textEffects

My way of doing it is one of many ways of achieving the same result. It’s not 100% accurate, but it comes the closest to any other solution that I have seen here. I’ve tried to have the text appear all at the same time, but with no luck.


#18

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.