Some Random Dude is a blog by P.J. Onori that covers design & technology in the broadest sense possible.

Use Tumblr? If so, you may find Off Franklin useful.

Daily Delicious – Video in Actionscript 3

Posted on 6 February, 2007 at 11:01am

For nearly the past year of my life, Flash Video has been the main focus of my work. I was fortunate enough to have the opportunity to build the next-generation Flash Video player for Current TV in 2006 and I am currently working on another video player project for another large online media organization. With Actionscript 3.0 becoming a more viable option for development with every passing day (Flash Player 9 is up to about 50% penetration already), I am very interested in how the video model works under the new version of Flash’s programming language. After mucking around in AS3 for a short time, I was surprised at how easy the migration is – luckily, video is no exception.

I read a well done mini-writeup on Actionscript 3 video and I came away very excited at the prospect of using Actionscript 3 from this point forward. The code is leaner, and once and for all we can create a video object exclusively through Actionscript (it is about time).

Also, due to the Actionscript 3 event model (details here), no longer do we need to see this:


netStream.onStatus = function(sObj:NetStatusEvent)	{
	trace("sObj.info.code")
}

This has never been fun due to scoping issues and just an overall bloat to your code.


netStream.addEventListener(NetStatusEvent.NET_STATUS, status);

public function status(sObj:NetStatusEvent):Void	{
	trace(sObj.info.code);
}

With event listeners, it keeps the code much more consolidated with no more scoping problems and nested functions. Beautiful stuff. My next video project will most definitely be in Actionscript 3, my hope is all my future projects will be as well.

del.icio.us link

The Discussion

2 Comments on “Daily Delicious – Video in Actionscript 3”
  • Thanks for the icons, dude. All the best. Cheers.

  • thats correct and thanks for the bit of code, really useful!