Tag Archives: Flex

Closing of easySwap

Thank you for your support!

As the add-drop period is over, easySwap will be down until the next semester, when it will re-open with more features and (hopefully) better performance. All of the comments posted are being considered and would eventually be implemented depending on my free time. So see you again next semester =)

Some statistics:
Total users: 1,233
Courses wanted to add: 1,667
Courses wanted to drop: 499
Potential matches: 3,833


Meanwhile you can keep posting suggestions and feedback here.


As we all know, course registration in NTU can be quite a headache. For those of you looking for a course to add or swap, you can try this link. It is basically a listing page where (hopefully) all those who wants to drop or add courses can meet and discover each other.


It is still in beta 1, and I hope to improve it with every feedback, thanks in advance!

p.s. Open to NTU students only =)

Getting video length in AS3

To get the length of a loaded FLV, you need to have an object listening to the meta data stream. Here’s how:

var vidClient:Object = new Object();
vidClient.onMetaData = onMetaData;
ns.client = vidClient; //ns is the netstream object

function onMetaData(metadata:Object):void {
lengthOfVideo = int(metadata.duration * 1000)+1;
trace("Length of flv from metadata = " + lengthOfVideo);


vidClient.onMetaData = null;
vidClient = null;

If you’re wondering how to actually load and play the flv file:

var nc : NetConnection;
var ns : NetStream;
var vid : Video;
var path : String = "test.flv";

nc = new NetConnection();
ns = new NetStream(nc);

//optional events to handle status and error
ns.addEventListener(NetStatusEvent.NET_STATUS, statusHandler);
ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);