Blog

Latest entries from the YAY! blog...

November 30, 2006

AS2 to AS3

So I sit down today to look at the outcomes from the recent meetings with Theatre Studies and to assess whether FMS can do the communication and background tasks required. The plan was to take the Media Manager application code and add some new screens to test the requirements.

The first test was a simple drag and drop sequencer; no problem – read the assets, create a visual array and let the user drag assets into sequencer ‘slots’, updating the play order array on the way. I quickly ascertain that I can’t create Video objects dynamically – they can only be accessed if already created on the Stage – not much use if you don’t know how many to create in the first place. I could load the target media into an FLVPlayback component, but I prefer the simplicity (and smaller footprint) of the Video class for this task.

The best solution seemed to be to use Actionscript 3 – the AS3.0 classes for handling streams and video objects have some subtle but useful improvements over the old AS2.0 ones. In AS2.0, you’d do something like this in order to attach a NetStream to a Video object:

var myNC:NetConnection = new NetConnection();
myNC.connect(fmsAppLoc);
var myNS:NetStream = new NetStream(myNC);
myVideo.attachVideo(myNS);
myNS.play(myVideoFileLocation);

The problem is, this would need an object already on the Stage called myVideo. And I might need anything from 1 to n of those.

In AS3.0 however, things are slightly different;

// dynamically create a Video object
var myVideo:Video = new Video();
addChild(myVideo);
var myNC:NetConnection = new NetConnection();
myNC.connect(fmsAppLoc);
var myNS:NetStream = new NetStream(myNC);
myVideo.attachNetStream(myNS);
myNS.play(myVideoFileLocation);

Cool – so now I can create as many Video objects as I need, when I need to. I haven’t been able to find out why the Video class is handled differently within Flash – you can create (and destroy) pretty much everything else dynamically.

Whatever; fire up the Flash 9 Alpha Preview IDE, change the Publish settings to AS3 and… bang, everything breaks with lots of namespace and binding errors, before I’ve had a chance to add my shiny new code. I’d expected problems of course, but after much fiddling and trying to make sure everything was typed, declared, imported etc., it remains broken in such a way that I reckon only a proper rewrite in AS3.0 will fix. For now I’ll do the proof of concept stuff using FLVPlayback objects, but I’ll recode the application in AS3.0 from scratch (probably at home when I get time), and if I’m going to do that I may as well try doing it in SEPY or Flex2. I can feel the fingers of OO dev tightening its grip around my neck…

November 23, 2006

The Coming Flash Desktop

Writing about web page http://avc.blogs.com/a_vc/2006/11/the_coming_flas.html

Interesting blog entry here and subsequent comments on Fred Wilson’s blog on how Flash is an increasingly popular method of delivering functionality to web users. Fred bemoans the fact that most of these applications won’t allow him to use them on his desktop, but a number of people have noted that Flex 2 and the forthcoming Apollo runtime will allow just that. One interesting comment from from a disgruntled Java developer:

Huh! What you describe, Fred, is what Java applets were supposed to be when they first came out. Little bits of software applications added into web pages. (And which can pop out of the pages on demand.) Sucks that a) it’s taken till now for that vision to come to fruition, and b) that it’s Flash, not Java, that’s making it happen.

November 16, 2006

Flash full–screen video

The latest release of Flash Player (9,0,28,0) now supports a neat full-screen video mode that automatically scales the movie to the user’s desktop. It’s always been possible to maximise a standalone Flash movie; the key difference here is that Flash can now scale a movie embedded within a web page to fit the screen, and the user can switch between modes easily.

While Flash Player and Flash video currently provide a great video experience that “just works,” it hasn’t quite delivered on the full immersive experience many people posting video to the web would like to provide for their viewers. To enable a richer experience, one that takes the viewer out of the frame of the browser and fills the entire computer screen, you can now take advantage of the full-screen mode in Adobe Flash Player 9.

In this demo, right-click the video and select ‘Go Full Screen’ to see it in action. Neat. I’ll set up some demos with our streaming applications soon to see how it performs with FMS.