feedback
Mar 22 2006

FreeTextBox 3.1.3 and new site

by John Dyer
Just upgraded the site from ASP.NET Forums 2.0.1 to Community Server 2.0

FreeTextBox 3.1.3 (2006/03/21)

  • BUG: Firefox 1.5.x script timeout problem
  • BUG: ASP.NET 2.0 mutiview problems
  • BUG: Extra quote in iframe classname
  • BUG: RenderMode bug (no Downlevel)
  • BUG: Resource Failures in ASP.NET 2.0 (error on /aspnet_client/FreeTextBox/Languages...)
  • BUG: InsertLink adds class=""
  • BUG: IE7 now works on live site (it has worked for some time in downloads, but not here on this site)

Mar 14 2006

Cross Domain Flash 8 BitmapData

by John Dyer

This week, we added a feature to our online education player that creates small thumbnails of upcoming slides (see sample class video).

To do this, I used a new feature in Flash 8 that allows copying a MovieClip as a bitmap in three simple lines:

// copy from source_mc -> target_mc
var bitmap = new flash.display.BitmapData(source_mc._width, source_mc._height);
bitmap.draw(source_mc);
target_mc.attachBitmap(bitmap, 1);

The only problem is that if a SWFon domainA tries to copy a MovieClip loaded from domainB (source_mc) and source_mc has any content from another domain (domainB), BitmapData won't work. The online education player loads the slide images from different domain (domainB) than that which hosts the player (domainA), so initally the BitmapData code didn't work. If we were loading SWF files from domainB, we could add the following code to the domainA fla/swf:

System.security.allowDomain("domainA");

But this doesn't work for JPGs, PNGs, etc. since you can't add this code to an image file. Macromedia suggested putting all the images inside SWFs, but that would not be feasible since we have 1000s of slides. Based on some code and a few emails from Frédéric v. Bochmann, we were able to get around this by creating a wrapper flash file that loads the images I wanted and then returns a BitmapData.

Instead of domainA.swf doing:

container_mc.loadMovie("domainB/image01.jpg");
bitmap = new flash.display.BitmapData(container_mc._width, container_mc._height);

domainA now does this:

container_mc.loadMovie("domainB/loader.swf?filename=image01.jpg");
bitmap = container_mc.getBitmap();

Then in domainB/loader.swf, the code looks like:

System.security.allowDomain("domainA");
this.createEmptyMovieClip("container_mc", 1);
this.container_mc.loadMovie(this.filename);
function getBitmap() {
    return new flash.display.BitmapData(container_mc._width, container_mc._height);
}

This is a simplified example, so you should add some code to check for the loaded state of the image01.jpg file (Frédéric v. Bochmann does this in his example). Also, when passing the filename=image01.jpg, you must use a fully qualified domain name (such as domainB/image01.jpg), or else the domainB.swf will try to load the file from domainA and Flash will throw error about cross-domain loading.

Try it out

Mar 6 2006

DotLucene (Lucene.NET) + KStemmer + Searcharoo = great!

by John Dyer

I'm in the middle of implimenting the current Lucene.NET (a port of the original Lucene in Java) on a new site currently under development: http://www05.dts.edu/search.

The overall search engine is composed of three parts:

  1. A site crawler: In the past, I've built search engines that utilites the raw data inside our CMS, but a crawler seems to work better when you have a fair amount of dymaic content. I found a nice crawler in Searcharoo. It's a full search engine by itself, but since I wanted to use Lucene, I only used the crawler portion Searcharoo.
  2. An indexer: This is where Lucene.NET (or DotLucene) comes in. When Searharoo downloads a page, the text is sent to Lucene to index.
  3. A Stemmer: Lucene does a great job of indexing and searching, but it doesn't natively have the ability to search for derivatives of a stem word. For example, if a user seraches for "tests", Lucene doesn't by default figure out the stem ("test" removing the plural "s") and then search for all words based on the stem ("test" "testing" or "tested"). But there is a port of KStemmer which handles all the stemming automagically handles stemming. Example http://www05.dts.edu/search/?q=tests

Right now I'm using Lucene 1.4 because the 1.9 is not yet out of RC stage and the new Highlighter 1.5 has some bugs.