Oct 30

Static classes are life savers for those who want a central data hubs where all shared variables are stored and accessed and modified. Some programmers think that this is dangerous since there is no real control over who gets to do what with the variables.. but for a scenario where several objects need to access the same data.. I can't think of better ways of doing so.

here's an example of a static class:

package com.packageName{

	public class DataStore{
		static var _DS:DataStore;
		static var dataArray:Array;

		public function DataStore(){
			// write something here
		}

		public static function getInstance(): DataStore	{
			if (_DS == null) _DS = new DataStore();
			return _DS;
		}

		public function doSomething(){
			// write code here
		}
	}
}

and then to call the function doSomething from this class, this is the way it's called:

com.packageName.DataStore.getInstance().doSomething();



Oct 30

I always try to opt from using the flv player component.. although it saves us half the work when it comes to accessing the properties and methods, sometimes it is still very heavy (in size) compared to this approach that really doesn't add anything worth mentioning

import flash.media.SoundTransform;import flash.media.Video;
import flash.net.NetConnection;
import flash.net.NetStream;

public class videoPlayer
{
	public function videoPlayer():void
	{

		var customClient = new Object();
		customClient.onMetaData = metaDataHandler;

		var nc = new NetConnection();
		nc.connect(null);

		var ns = new NetStream(nc);
		ns.client = customClient;
		var vid = new Video(320, 240);
		vid.name = "vid";

 		this.addChild(vid);
		vid.attachNetStream(ns);
 		ns.play("videos/videoSample.flv");

		st = new SoundTransform();
 		st.volume=0.5;

		ns.soundTransform=st;
	}

	public function metaDataHandler(infoObject:Object):void {
		for (var prop in infoObject){
			trace(prop+" : "+infoObject[prop]);
		}
	}

}



Oct 15

http://www.gugga.com/GuggaFlashFramework/
I am still waiting for the Fuse library to be ported into AS3.. IU can't bring myself to get back into the flash built-in Tween classes.
I heard some recommendations for tween-lite... I wonder if I should start dipping my feet into that puddle or just wait until I see something else emerging.




Oct 15
Thermo-Img
"Thermo" is an upcoming Adobe product that makes it easy for designers to create rich Internet application UIs. Thermo allows designers to build on familiar workflows to visually create working applications that easily flow into production and development.

interesting, eh?