Dynamic html textfield wrapping problem

are there any extra rules for dynamic textfields that receive html data?
on my site i’m creating a textfield & bringing in external text to fill it. all’s well unless i enable html on the textfield, and attempt to use [p] or [br] (which i know isn’t officially supported - i only tried after [p] produced strange results). the first ‘paragraph’ or two will be wrapped properly, but after that flash decides to continue on the one line, outwith the limits of the created textbox.
ie.

<----text field size------>
this is the text from my
dynamically created text
box. paragraph one wraps
ok.

again, this one seems to
work properly.

this is another lot. for some reason it continues on and on.

as does this one, which does exactly the same. etc.

(sorry i haven’t posted a link to the file - my ftp’s down)

the textfile does not contain any carriage returns, and is properly set out (at least, as far as i know). if i remove the [br] or [p] tags from the imported text, everything wraps properly again, as it does if i disable html on the field. text is added using x.htmlText="". other formatting (such as bold) doesn’t seem to affect the wrapping, working as i’d expect. the size of the imported text doesn’t seem to make a difference.

changing the contents of the textfield to something else leaves the characters outwith the field size on screen, until i zoom/pan etc.

i’ve tried changing the settings of the field (such as alignment, font size, etc), and with changing setTextFormat/setNewTextFormat, to no avail.
selectable = 0, multiline = 1 & wordWrap = 1 are all in use on the field.

any help would be much appreciated, as it’s confusing the hell out of me.
pete

Flash counts all carriage returns in the text file as a new line (like if you hit “Enter” in your textfile or something).
So technically your textfile must be on really really long run on string. Like…

myTextVariable= Hello this is some text<BR>new line starts here and it will keep on going my friend<BR>Yep, thats right, another new line.. wow this could go on forever!

That might be why your spacing is off.

thanks for the response.
i thought about that when i first found the problem, trying to use hard carriage returns in the flat database, but it didn’t make any difference on the output (the text comes from a cgi script, i moved to flash reading from a txt file on the chance that could have been the root of my problem).

http://www.freneticvirus.co.uk/testmedo/txtmedo.swf

the above is a link to a swf created using my text method. the field on the left is a placed textfield (created using the flash tools), the one on the right is a dynamically created field with the same information (character leading is slightly different, but that’s all).
both get the external txt at the same time, yet the flash created one doesn’t seem to have the wrap problem. again, it’s the same using [br], [p][/p] or hard carriage returns.

Hmmm, odd. The only thing I can think of is that your textbox properties are set to Multiline NoWrap instead of just Multiline.

Click on your textbox and open the properties panel and check that drop down box.

If not… can your post your files in a .zip file (.fla and .txt)

here’s the part of the site that deals with the text formatting (and a basic text file that’s laid out to be loaded by it).

pete

Hmm, your dynamic textbox doesn’t seem to want to show up for me.

something else i never thought of - you would have to change the font referenced in the code (currently ‘europe’) to something you have on your machine for it to show.

:-\ I should have known that… 'DOH!

Oddly enough though, I don’t think this is anything you did. I think it may be a bug in Flash! Why do I think this I think you might think to ask me I think (confused?), well I think the answer is simple I think.

Ok… enough with acting stupid. My answer to that would be this. Did you try NOT embedding the font? I unembedded the font, and it worked perfectly, but as soon as I changed that 0 back to a 1, the problem arose again. I too am now curious why this happens :-\

Maybe post on macromedias forum asking if this is a bug, because I really think it might be.

shall do.
thanks again for taking the time over this - it’s much appreciated.

pete

No problem. Please do let me know if you find anything out :slight_smile: