The mobile version of WMN.fm for Nokia phones will target symbian^3 devices running Flash Lite 4.0. After researching Nokia’s WRT, we decided to build the app primarily using Javascript for managing the views or screens in the application, and Actionscript for streaming media playback.

This quickly lead to creating JSLogger, a dirty little utility class that will let you centralize your debugging statements in the javascript console.

File: /fm/wmn/utils/JSLogger.as

package fm.wmn.utils
{
	import flash.external.ExternalInterface;
	
	public final class JSLogger
	{
		public static function log(p_msg:Object, p_type:Object=null, p_trace:Boolean=false) : void
		{
			if (p_type)
				ExternalInterface.call("console.log", { type: p_type, msg: p_msg } );
			else 
				ExternalInterface.call("console.log", "["+new Date().toTimeString()+"]: " + p_msg);
			
		}
	}
}
Advertisements