all groups > flash (macromedia) > january 2004 >
You're in the

flash (macromedia)

group:

formatting text in a text scroller..?



formatting text in a text scroller..? Chris
1/22/2004 10:19:52 PM
flash (macromedia): Hi

I am using flash 5

I want to create a scrolling text box with scrollin text in for a
'resume/cv' , and I want it to have particular formatting and spacing, is
this achieveable ???

sincerely
Chris



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.564 / Virus Database: 356 - Release Date: 1/19/2004

Re: formatting text in a text scroller..? urami_
1/23/2004 4:02:52 PM
[quoted text, click to view]

Yes it is achievable

Formatting can be a bit of pain. Each New line in your variable string
will load as double space in dynamic textfield because Flash interprets carriage
returns from windows as two carriage returns because it's built to handle the Mac carriage
return ("\r") and the UNIX carriage return ("\n") and windows carriage returns use both
at once ("\r\n").

If you have fancy text positioning , controlling it can be challenge .

But there is always some work around.
Using XML object and treat properly all the spacing and load it w/o smallest problem.

Let me demonstrate text file with awkward positioning :

http://www.flashfugitive.com/ang-zhang/text1.txt

This would be badly messed while using ordinary loadvariables action .

Here how it will look once loaded with XML instead :

http://www.flashfugitive.com/ang-zhang/loadPorfolio.swf

How to do it :

Type your text just the way you like it too look , like in the sample of txt file above .
give it name text.txt . It does not require any variable name , just text .

In flash movie make dynamic Textfield with Variable name 'mytextfield', make sure you check the
HTML formatting button .
Than all you need is xml that will load the text, rid off the spaces and position just the way it was
written :


blah = new XML();
blah.onData = function (data){data =
data.split("\r\n").join("\r");mytextfield = data;}
blah.load("text.txt");

that's pretty much it ....



Regards


urami_*

<xmas>
http://flashfugitive.com/
AddThis Social Bookmark Button