Posts Tagged ‘Adobe’

Mar 01 2011

FLV logoWhen working with Flash video I always end up using extra time finishing a project. This is mainly because I get these project not so often. So everytime I have to create video content I have to brush up my as3 video skills.

In this posts I will point out a few pitfalls when doing a Flash as3 movie project.

Decide where the videocontent is placed

This is handy to know beforehand. It saves a lot of time and effort to do it first time right. Are you going to progressively download the movie or is it streaming? Does it come from a flash mediaserver? Know what you are working with before you start.

Create a prototype

Start with creating a prototype so you know the pitfalls. And you know the steps to recreate the experience. Afterwards you can tweak layout, performance etc.

When using Cue Points

FLV logoMake sure you export your movie as .flv. F4v doesn’t support cue points. Cue points are a feature of the FLV video container format. FLV is a proprietary format developed specifically to complement Adobe Flash.

Cue Point code

Handling cuepoints in ActionSctipt3 is easy once you know the drill. One of the simplest methods is to create a simple Object which processes the onCuePoint and onMetaData event handlers in ActionScript 3.0. You can see an example of this in the following code:

var customClient:Object = new Object();
customClient.onCuePoint = cuePointHandler;
customClient.onMetaData = metaDataHandler;

var myVideo:Video = new Video();
addChild(myVideo);

var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.client = customClient;
myVideo.attachNetStream(ns);
ns.play("http://www.helpexamples.com/flash/video/cuepoints.flv");

function cuePointHandler(infoObject:Object):void
{
    trace("cuePoint");
}
function metaDataHandler(infoObject:Object):void
{
    trace("metaData");
}

Or you can create a CustomClient class which handles the meta data and cuepoints.

package
{
	public class CustomClient
	{
		public function onMetaData(info:Object):void
		{
			trace("metadata: duration=" + info.duration + " width=" + info.width + " height=" + info.height + " framerate=" + info.framerate);
		}
		public function onCuePoint(info:Object):void
		{
			trace("cuepoint: time=" + info.time + " name=" + info.name + " type=" + info.type);
		}
	}
}

These are the basics to start embedding video content.

Other resources

Nov 10 2010

Today I installed the air for android runtime. This afternoon going to make my first Android Air App.

Think I’ll create a Hello world app first. Saw some realy nice tutorials on this by Lee Brimmelow. Check out his site for some video tutorials about Air on Android.

I’ll update this post with the source of my first app.

[update]
My collegue Davie Schoots just installed the flashbuilder 4 beta for mac. I’ll ask if he wants to share some knowledge about setting up the dev environment.
Keep you posted.

[update]
Been busy for sometime setting up the dev environment. I’m using intelij10 with ant scripting for building and deploying the app to the emulator/phone. For more info checkout the links. Make sure you install the Android SDK. Then download the Flex Hero SDK. Download/install Intelij 10 then create a new Flex project. For deploying to your phone I’m going with antpile or follow this tutorial.

Links: