if (youtubeIDRX.test(youtubeInput)) {
var RXresultArray:Array = youtubeIDRX.exec(youtubeInput);
if (!RXresultArray) {
// if there's nothing in the array, they probably didn't give us the right link
trace("not a tube.");
} else if (RXresultArray[1]) {
// if there's something here, it's probably a URL they gave us
trace(RXresultArray[1]);
youtubeLoader.load(new URLRequest(youtubeFeedURI + RXresultArray[1]));
} else if (RXresultArray[2]) {
// if there's something here, they pasted an embed tag, silly duffers...
youtubeLoader.load(new URLRequest(youtubeFeedURI + RXresultArray[2]));
trace(RXresultArray[2]);
} else {
// I have no idea how they could get here but anyway, we can't help them...
trace("not a tube?");
}
} else {
// I don't think it was a youtube link they gave us..
trace("not a tube?");
}