Recently, while working on my portfolio, I was presented with the problem of displaying YouTube content extracted from an RSS feed in Flash. On the one hand there was the difficulty of parsing embed and object tags and extracting relevant data from the mess I was given, and on the other hand there was the problem of displaying the content itself.

YouTube provides documentation for their api, but after digging around online I was surprised to find that nobody had gone through with packaging it in a format I was willing to work with. There is an ActionScript 3 YouTube Wrapper available online, but it presumes that the Chromeless YouTube Player (http://www.youtube.com/apiplayer?version=3) you download to play videos with will be accessed using a combination of the static ExternalInterface class and external JavaScripts.

This seems, to me, to be unnecessarily complicated.

I’ve gone through the trouble of picking through the API and creating a simple class that loads a chromeless player and exposes methods you can use to manipulate it and display content from YouTube, without requiring any external javascript.

The application above is written in Actionscript 3. Basic usage is as follows:

import com.agitcraft.youtube.YouTube;
import com.agitcraft.youtube.YouTubeEvent;
_tube = new YouTube();
_tube.cueURL("http://www.youtube.com/v/-CsA1CcA4Z8", 0);
addChildAt(_tube, 0);

Each of the methods made available in the official YouTube API is available in some form or another via this set of classes. When I have a little more time I’ll follow up with official documentation and availability via google code.

Download AS3 YouTube Classes

Categories: APIDownloadsFlashUncategorized
Tags:
Published: 01.14.10 :: 6 Comments »


Erick Schonfeld recently wrote an interesting article on TechCrunch discussing the ramifications of Adobe Flash CS5′s “publish for iphone” functionality.

In a nutshell, the next version of Flash will allow you to develop applications that will run on an iPhone using nothing but your existing skill set in ActionScript 3. Initially I objected on the grounds that I feel that good developers should be willing to learn a new language if that language is best suited to accomplish the goals they’ve set for a project. On the other hand, this new functionality will provide an immediate window for me to get involved in iPhone development without having to invest any time learning a new language.

More importantly though, Schonfeld points out that the iPhone developer community is about 125,000 strong, while the Flash development community numbers over 2 million. When these tools debut, what will that mean for Apple’s figures on the number of apps available in the app store? We can probably anticipate an explosion.

Furthermore, what will this mean for other mobile platforms? In the past, choosing whether to develop for the iPhone or for Android would have meant, at least, choosing which language I wanted to devote the next few weeks to studying. Now it seems obvious to develop for the iPhone over Android.

The full article is available here: This Will Be The Year Adobe’s 2 Million Flash Developers Come To The iPhone.

Categories: ArticleFlashMobile
Published: 01.11.10 :: No Comments »