Bensmeets.com

Rich Internet, Interaction design and User Experience

Archive for July, 2004

Skinner components

  • Filed under: RIA
Wednesday
Jul 21,2004

Grant Skinner en co. , are serving my every needs as it seems. They are developing a lightweight version of an Component set for Macromedia Flash. The features they are intending to implement which are an improvement against the current sluggy Macromedia components are:

  • 75% smaller filesize than Macromedia’s v2 components
  • much lower CPU usage
  • simplified skinning system
  • advanced tabbing management
  • Flash Player 6 compatible
  • polymorphic with v2 components, no learning curve. In most cases, v2 components can be seamlessly replaced with glic with little or no additional modifications

Let’s hope they succeed :) You can follow their efforts at this site.

Macromedia Flash LogManager

  • Filed under: RIA
Tuesday
Jul 20,2004

One thing i miss in Flash, is a way to log data in my application. It might be in there somewhere, but i couldn’t manage to find it. So to make myself usefull, i wrote a simple (very simple) LogManager class.

What it does is ease the way you normally trace any events you want to keep an eye on to the output window. It also has some sort of support for logging to an php/asp script eventually. This way you can create logs into txt files and review them at a later time, after your visitors have encountered any logged event.

You can download the zipfile in the resources section.

Here is the code:

 /*
* Author:					Ben Smeets
* Date:					02/07/2004
* Original Filename:		CLogManager.as
* Description:				Makes formatted tracing and logging
* 							easy :)
*/;
class nl.flashZone.CLogManager{	private var _intTreshold : Number;	private var _blnUseTimestamps : Boolean;	private var _strLogUrl	: String;	// constructor	public function CLogManager ()	{		_intTreshold = 0;		// show all logs by default		_blnUseTimestamps	= true;		// show timestamps by default		_strLogUrl	= "";		// do not send logdata to an url by default	};	// getters/setters	public function set Treshold (num : Number) : Void	{		_intTreshold = num;	};	public function set UseTimestamps (bln : Boolean) : Void	{		_blnUseTimestamps = bln;	};	public function set LogUrl (str : String) : Void	{		_strLogUrl = str;	};	public function get LogUrl () : String	{		return _strLogUrl;	};	// public functions	public function logDebug (str : String) : Void	{		if (str.length != 0 && _intTreshold < 1)		{			output ("[DEBUG" + timeStamp () + "]: \t\t" + str);		};	};	public function logInfo (str : String) : Void	{		if (str.length != 0 && _intTreshold < 2)		{			output ("[INFO" + timeStamp () + "]: \t\t" + str);		};	};	public function logError (str : String) : Void	{		if (str.length != 0 && _intTreshold < 3)		{			output ("[ERROR!" + timeStamp () + "]: \t\t" + str);		};	};	// private functions	private function timeStamp () : String	{		if ( ! _blnUseTimestamps);		return "";		var tDate = new Date ();		return " " + tDate.getDate () + "/" + tDate.getMonth () + "/" + tDate.getFullYear () + " " + tDate.getHours () + ":" + tDate.getMinutes () + ":" + tDate.getSeconds () + "." + tDate.getMilliseconds () + " ";	};	private function output (str : String) : Void	{		// we can always trace logdata to output window		trace (str);		// we can also choose to log to an url		if (_strLogUrl != "")		{			loadVariables (_strLogUrl + "?Log=" + str, "GET");		};	};};

Example usage:

import nl.flashZone.CLogManager;

var gLog:CLogManager = new CLogManager();

// show date/timestamp per line yes or no (try difference)gLog.UseTimestamps = false;

// what levels to show?// 0 = all// 1 = only logInfos and logErrors// 2 =  only logErrorsgLog.Treshold = 0; 

_root.onEnterFrame = function() {	gLog.logDebug("You see! nice pretty log line.");	gLog.logInfo("You see! nice pretty log line.");	gLog.logError("You see! nice pretty log line.");}

New FlashMX 2004 update on it’s way

  • Filed under: RIA
Wednesday
Jul 14,2004

The Macromedia Flash Team is blogging away about an upcoming updater for Flash, later this summer. Should get interesting :) Components, a usefull cornerstone for any RIch Internet Application, are being updated as well.