Drupalcon SF 2010 Day 1 Review

Day 1 for me started off pretty well with a campy Intro to Druapl(con), then a great presentation from Lullabot’s Jeff Eaton, who gave a high level overview of Drupal architecture. Things were choppy after that with a session about Theme preprocess functions that was plagued by a malfunctioning demo and a presenter who spoke too fast.

Lunch (burrito) was good, Dries’ keynote was solid, and a lively session about Drupal 7 delivered by Angie Byron had things moving along well again. But a simplistic and hastily delivered CCK session and a session about executing a Drupal implementation that was little more than common sense provided a frustrating end to the day.

Getting ready for an SEO session now that will hopefully kick off an improved Day 2.

Drupalcon 2010 SF Beckons

I’m off to my first Drupal con in just a few hours. Not at all sure what to expect. Being essentially a novice, I just hope I am able to grasp enough during the sessions to make the three days worthwhile.

I’ve been tracking all the #drupalcon tweets and the “Drupalistas” are nothing if not enthusiastic (the hard core pre-conference stuff started Saturday, two days before the “regular” conference). I’m terrible at networking, but I hope to meet a few Drupal folk. Groove 11 can always use more Drupal resources.

I also have a nagging feeling that in two or three months I will wish I could go back to Drupalcon SF 2010 and do it over again with the knowledge gained after the conference.

Actionscript: Finding the Width of the First Line in a Dynamic Text Field

This is so ugly (or is it?) that I had to post it.

How does one find the width of the first line of a multi-line dynamic text field via Actionscript (AS2, specifically)? I couldn’t find a good solution to this via the usual forums, so I did it myself.

Here’s what I came up with. Pass in the string from the dynamic text field.

function getFirstLineWidth(_str:String):Number
{
	var firstLineWidth = 0;

	var wordArray:Array = new Array();
	wordArray = _str.split(" ");

	// "test_text" is a dummy text field on the stage. It must be
	//  the same width as the text field we're trying to measure.
	// It may be better to create a new text field on the fly then
	//  destroy it, but I needed to run this function a lot and wanted
	//  avoid the overhead.
	test_text._width = _textFieldWidth;
	test_text.text = "";

	while(wordArray.length > 0)
	{
		test_text.text += wordArray.shift() + " ";

		// Once the text goes to two lines, return the last width we recorded
		if(test_text.textHeight <= singleLineTextHeight)
		{
			firstLineWidth = test_text.textWidth;
		}
		else
		{
			break;
		}
	}

	return firstLineWidth;
}