Close captioned video for the web using Macromedia Flash

UPDATED 1/9 AT 5:20 CST WITH NEW VERSION INFO

A colleague of mine with the State of Minnesota asked me if I knew how to do close captioning of video for the web. Admittedly I did not, but that didn’t stop me from looking into it. Within a five minute search of Google, I found a link on the Law, Health Policy & Disability forum at the University of Iowa showing a proof of concept, that you can indeed take a video file and apply some level of close captioning to it using Flash.

To save you some time of hunting all the files down, I’ve put together an instruction page with a demo of how it works. The only grunt work you have to do is: acquire the exact length (in seconds) of your video file and create a close captioning text file based upon the example one I link to. You then just have to modify an XML file and you’re all set to go. See the instructions for details. (Version one had you passing a bunch of variables and it was kinda clunky to work with. In version two you’re able to put everything you need in a single XML file.)

I hope this helps you out. It’ll sure help me out when it comes time to provide close captioned videos for the State.

Digg This
January 9, 2007, 4:48 pm

Executive Briefing Center

Well, I’ve just recently finished a really cool, new media piece for my employer’s Executive Briefing Center (a fancy name for meeting room). Since I don’t really want HTTP_REFER references coming from my blog, copy and paste this URL into your browser, download the referenced zip file, and run the presentation contained therein. It rocks — if I do say so myself.

Digg This
February 17, 2006, 5:00 pm

Dynamic Stock Information

I’ve been looking for options for a stock ticker for an intranet page we’re developing here and the current feed that’s available to us right now is very limiting—we’re basically forced to accept a feed with certain dimensions, color scheme and a nasty “logo” to boot.

So my first reaction… “AGH, there’s gotta be someone out there doing an XML/RSS type of stock info feed out there”.

I found a posting on someone’s blog about how they’ve developed an XML result by simply querying Yahoo. While the gentleman didn’t share his code with the world, I thought I would at least share the URL string to use when querying Yahoo. Insert the ticker symbol where it’s noted in bold:

http://finance.yahoo.com/d/quotes.csv?s=UNH&f=sl1d1t1c1ohgv&e=.csv

With the above example, here is what is contained in the .csv file that it dynamically gives me:

“UNH”,51.87,”7/12/2005″,”2:40pm”,-0.56,52.53,52.90,51.75,4787200

a simple comma-delimited file with important stock information. It provides (in this order) symbol, last trade amount, day of last trade, time of last trade, change (plus or minus), opening value, day’s high, day’s low, and what I presume to be volume.

My next goal is to see how I can take that information and make my own xml file and/or parse it with flash to create a stock ticker that’s a bit more flexible to work with.

Anyway, thought I’d pass on that tidbit of information.

Digg This
July 12, 2005, 3:00 pm

Moving Selected Item in UI List

So following up to my other follow-ups ;) on the UI list selection boxes, I’ve added functionality that can move a selection up or down in the list order. In this example, the UI list box instance name is selectedModulesBox.

Here’s the code that makes it move up in the sort order:

// ######## this example moves an item up in the sort order (example: from index 2 to index 1)
on (release) {
// the UI list instance name is "selectedModulesBox"
selectedIndexNumber = selectedModulesBox.selectedIndex; // get current selection index number
previousIndexNumber = selectedIndexNumber - 1; // get the destination index number
if (selectedIndexNumber > 0) {
// temporarily store the data we're going to be moving into some variables so we don't lose it
movingSelectedItem = selectedModulesBox.getItemAt(selectedIndexNumber);
movingPriorItem = selectedModulesBox.getItemAt(previousIndexNumber);
// replace the data in originating and destination indices
selectedModulesBox.replaceItemAt(previousIndexNumber, movingSelectedItem.label, movingSelectedItem.data);
selectedModulesBox.replaceItemAt(selectedIndexNumber, movingPriorItem.label, movingPriorItem.data);
// move the selection box up in the order
selectedModulesBox.selectedIndex = previousIndexNumber;
}
}

to move it down in the sort order, use this code:

on (release) {
selectedIndexNumber = selectedModulesBox.selectedIndex;
nextIndexNumber = selectedIndexNumber + 1;
if (nextIndexNumber < selectedModulesBox.length) {
movingSelectedItem = selectedModulesBox.getItemAt(selectedIndexNumber);
movingNextItem = selectedModulesBox.getItemAt(nextIndexNumber);
selectedModulesBox.replaceItemAt(nextIndexNumber, movingSelectedItem.label, movingSelectedItem.data);
selectedModulesBox.replaceItemAt(selectedIndexNumber, movingNextItem.label, movingNextItem.data);
selectedModulesBox.selectedIndex = nextIndexNumber;
}
}

What is actually forcing the selection highlight to move with the change in order is the line: selectedModulesBox.selectedIndex = nextIndexNumber;. What that’s doing is simply saying that the new selectedIndex value in the UI list is the destination index number.

Lose ya? Leave your questions and I might be able to answer them.

Digg This
June 23, 2005, 12:01 pm

Followup: adding & removing items to/from components

In a follow-up to my previous post, I mentioned that I had two UI components (selection lists) that I wanted to be able to add to list2 from list1 by selecting items in list1 and clicking a button. Likewise, I wanted to remove selected items from list2 by clicking another button.

Because I’m pretty new with Actionscript 2.0, I’ve had to hunt-n-peck through the help guide in Flash and try different things out. So here’s all you need to do to make it work.

First you need two instances of a UI list box. For this example, List1 has a list of items to choose from. List2 is the target list where we want to transfer our selection to with the click of a button. Give the first UI list box an instance name of List1 and the second List2.

You’ll need two buttons, one to transfer selected items from List1 to List2 and one to remove selected items from List2.

On the transfer button, use this actionscript:

on (release) {
tempArr = new Array();
tempArr = _root.List1.getSelectedItems();
for (i=0; i _root.List2.addItem(tempArr[i].label, tempArr[i].data);
}
_root.List2.dataProvider = tempArr;
}

What this code essentially does is goes through List1 and throws the selected items into an array (tempArr). We cycle through that array and add the label and data to List2.

On the remove selection button, use this actionscript:

on (release) {
myArr = new Array();
myArr = List2.selectedItems;
for (i = 0;
i < myArr.length;
i++) {
List2.removeItemAt(List2.selectedIndex);
}
}

This snippet makes an array of the selected items in List2 and simply removes them from the List2 UI list. Pretty straight forward stuff.

The most complicated part of getting to this was understanding what I could and couldn’t do with these lists. Hope you find this useful.

Digg This
June 23, 2005, 9:46 am

Yard Improvement

It seems that I’ve been spending less and less time on my PC at home these days now being a home-owner. Lately I’ve been focusing on getting the yard into shape, taking a bit of a break from finishing the bathroom. A lot of landscaping ahead of us—we wanna get the grass back into shape and get a flower garden going this year.

I’m doing some interesting Actionscript-related things at work these days. That module selection application that I eluded to in a prior entry is taking an interesting turn. I’m trying to do some moderately-complicated form work within Flash—form work that could be done in a heart-beat using JavaScript… but not so easy in Flash.

I’ve got two UI (User Interface) component objects and am trying to transfer selected data from comp1 to comp2 and remove data from comp2 based on which button you choose.

To transfer from one UI comp to another:

on (release) {
tempArr = new Array();
tempArr = _root.selectionBox.getSelectedItems();
for (i=0; i _root.targetBox.addItem(tempArr[i].label, tempArr[i].data);
}
_root.targetBox.dataProvider = tempArr;
}

Slap that code in a “transfer” button and it will copy the data from selectionBox over to targetBox. Now where I’m stuck is removing the selected data elements from targetBox. That’ll be todays’ project.

Digg This
June 23, 2005, 9:05 am

URL Strings Handled by JavaScript & Flash

One of the challenges that I face in my Flash development is the handling of dynamic choices in data selection in a not-so-dynamic environment. Because usage and access to databases and dynamic scripting requires an act of congress, I am left with the necessity of improvisation and taking advantage of as many client-side abilities as I can.

Challenge: I’ve got an XML file with an array of choices that the user can choose from. They’re basically flash-based marketing modules—animations with voice-overs about our various services and options. Each user, employee, or employer can choose which modules they want to view and that means that there could be hundreds of thousands of possible combinations of modules that people can view and in the order that they want.

Limitations: A static XML file containing data about the flash modules, HTML, JavaScript,

(more…)

Digg This
June 20, 2005, 9:46 am