» in my experience...

» home | about | contact | résumé
» archives | donate | rss syndication

»
»
A lit AOL campus pathway.


Communiblog Communiblog expressed as RSS 2.0
Here at IMX
Memes R' Us
freetheaudio2.jpg
SuperNova 1987A from 1994 to 2003
GarageBand

The Flash TextArea component doesn't support 'condenseWhite.'
[ Posted by Dan on November 19, 2003 | 4 Comments ]

As of this writing, and as far as I know, in the Flash MX 2004 TextArea component, Macromedia missed an important detail when they created the TextArea component properties. You can say that the text area can be formatted by HTML, but that HTML formatting inherits the whitespace formatting as though a supersetted 'pre' tag was present. It makes for ugliness, and requires ugly workarounds (AFAIK). I sent email to the author of a good article that mentions this issue. In the article he said...
Now, a quick note on ignoreWhite: this normally excludes all spaces, linebreaks and carriage-returns from being counted when our XML is brought in to Flash (parsed), however I must admit I can't get it to work in my example or the Macromedia example I looked at earlier - you can see this for yourself by inserting a carriage return after one of the opening tags and then viewing the results in Flash - if anyone knows why this happens then please email me so I can amend this tutorial. I've left it in for the time being :]
I've been playing around with this, and have a few notes. First, condenseWhite would probably be the property to use/set as that is what is available in a dynamic text box (as opposed to ignoreWhite).

Unfortunately, it looks as though Macromedia did not implement that property in the TextArea component (and because components are compiled, you can't add that property support). If you remove all white space from the original xml doc (and you still have to use ignoreWhite while loading the XML) you can fix some of the display weirdness. That's a less than optimal solution though.

I may have to figure out how to write my own component, but that looks like it's out of my league right now.

<update when="November 22, 2003">

I wrote a function that deals with this problem...

	// This function kills any characters in the passed in string
	// that are considered to be white space. White space is defined
	// as anything *below* ASCII/Unicode character code 32.
	// We want code 32 because that's a space, and we want words separated, right?	

	function killWhiteSpace(theData) {
		var myNewString:String = '';
		var j:Number;
		  for(j = 0; j < theData.length; j++) {
			  if(theData.charCodeAt(j) > 31) {
				  myNewString += theData.charAt(j);
				  }
		  }
		 return myNewString;
	}
Use this function before you place your HTML into a TextArea component.

</update>

 

<comment when="December 19, 2003">

thanks for pointing me to the solution,try:

TextAreaInstance.label.condenseWhite=true

</comment>

-Posted by tomo on December 19, 2003 09:16 AM

I tried that, and it actually worked. Thanks tomo!

-Posted by Dan on December 19, 2003 02:22 PM

Hey ya'll!!!

I was wondering, is there a way to set the default textsize in an textarea?


-Posted by Tomas Engström on May 14, 2004 07:14 AM

I'm having trouble getting the HTML anchor to work although other HTML features e.g. do seem to be supported
Anyone else having the same problem

-Posted by AndyC on July 20, 2004 09:26 AM




Comment posting has been turned off because I don't have enough time and will to deal with the constant comment spamming. I'm very sorry and will fix this sometime soon (soon = before 2004 ends).

MovableType AmphetaDesk
NetNewsWire BlogTree Subscribe with Bloglines RSS Feed
Copyright © 2001 - 2003 by Daniel Kapusta