Closed Captioning Text Stripper

What is it? You might be thinking now - say what? :) We've been working on integrating closed captioning to some of the videos. Testing it out first on youtube. We really wanted to start seeing how this can work on our video pages as well.

[kml_flashembed publishmethod=”static” fversion=”8.0.0″ movie=”http://blog.everythingfla.com/wp-content/uploads/2011/08/CCTextStripper.swf” width=”550″ height=”400″ targetclass=”flashmovie”]

Get Adobe Flash player

[/kml_flashembed]

What is it?

You might be thinking now – say what? 🙂 We’ve been working on integrating closed captioning to some of the videos. Testing it out first on youtube. We really wanted to start seeing how this can work on our video pages as well. Starting from a few pages to see how you guys react to it (as this is a lot of work!)

So the goal of this small application is to enable us to do quick conversions of copy without manual labor.

Hot does it work?

Select if you want to delete extra lines and what copy you want to get deleted. In our case if a copy starts with ‘0:’ we don’t want it. In your case it might be something else. I left a way for you to change it. Paste your copy onto the text area – done – you can now click ctrl+c and copy your new copy.

Original sample copy:

0:00:01.069,0:00:06.540
We created some objects, we added them to the stage.
I’m just going to delete them quickly and add a new object

0:00:06.540,0:00:10.099
onto the stage, not that I really have to,

0:00:10.099,0:00:15.090
just for fun.
Click on “v”,

0:00:15.090,0:00:18.490
I just have to make sure that i’m back in my arrow mode.

0:00:18.490,0:00:22.619
Now, the next thing I want to do is talk about
the properties panel as we said before,

The code:

the code is very simple:

import flash.text.TextField;
import flash.events.Event;

var txt:TextField;

txt.addEventListener(Event.CHANGE,onChange);
remLines.addEventListener(Event.CHANGE,onChange);
var ent:TextField = new TextField;
ent.text = “\n”;

var enter:String = ent.text;

function onChange(e:Event):void{
var lines:Array = txt.text.split(enter);

lines = lines.filter(isvalidCopy);
txt.text = lines.join(“\n”);
txt.setSelection(0,txt.length);
}

function isvalidCopy(cpy:String,index:int, arr:Array):Boolean{
return !((remLines.selected && cpy==””) || cpy.indexOf(filterText.text)==0);
}

– go from a “zero to geek” | 02Geek.com – ©

Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz