Archive for November, 2009

I've updated the debugger used in SomaCore. You can know click on everything to parse the objects and I've added a FPS + Memory meter. I'll continue to improve the debugger with my needs, next step might be a Garbage Collection monitor.

Click here to see the debugger in action.

Tips: if you close the debugger, type "debug" to get it back.

Here is a little bit of code in case you want to want to use the debugger without using the SomaCore Framework.

Actionscript:
  1. package {
  2.    
  3.     import flash.display.Sprite;
  4.     import com.soma.core.Soma;
  5.     import com.soma.core.interfaces.ISoma;
  6.     import com.soma.debugger.SomaDebugger;
  7.     import com.soma.debugger.vo.SomaDebuggerVO;
  8.     import com.soma.debugger.events.SomaDebuggerEvent;
  9.    
  10.     public class Main extends Sprite {
  11.        
  12.         function Main() {
  13.             // create soma application
  14.             var app:ISoma = new Soma(stage);
  15.             // create debugger options
  16.             var vo:SomaDebuggerVO = new SomaDebuggerVO(app, SomaDebugger.NAME_DEFAULT, [], true, false);
  17.             // create debugger
  18.             var debugger:SomaDebugger = app.createPlugin(SomaDebugger, vo) as SomaDebugger;
  19.             // use debugger
  20.             debug("Hello Debugger");
  21.             debug(this);
  22.             debug(app);
  23.         }
  24.        
  25.         private function debug(obj:Object):void {
  26.             // use app.dispatchEvent() from a class that is not in the display list
  27.             dispatchEvent(new SomaDebuggerEvent(SomaDebuggerEvent.PRINT, obj));
  28.             // events available:
  29.             // SomaDebuggerEvent.SHOW_DEBUGGER;
  30.             // SomaDebuggerEvent.CLEAR;
  31.             // SomaDebuggerEvent.PRINT;
  32.             // SomaDebuggerEvent.HIDE_DEBUGGER;
  33.             // SomaDebuggerEvent.MOVE_TO_TOP;
  34.         }
  35.        
  36.     }
  37.    
  38. }

Vote in HexoSearch

Comments No Comments »

Following my previous post about MVC design philosophy and an AS3 MVC Framework that suit my needs and expectations, I've started using SomaCore in a relatively complicated AIR modular application, and I'm really enjoying it.

I made some small changes to the code and I thought it would be a good idea to provide you the sources. SomaCore was a missing tool in my actionscript work.

I've started to feel the power of the native Flash event system (even if criticized!) by being able to listen to commands independently of the commands itself (and what the command is doing), or being able to "preventDefault" any command, or to monitor very easily everything that is going on in the framework. The wires have been a good help to keep my code very clean without tons of classes, while keeping my models and views completely free of framework code.

I also found out some kind of hidden capabilities I didn't think about while making it. One of them is an "easy module communication", so easy that, you have absolutely nothing to do to enable it. When I say module, it could be another SomaCore instance, a loaded SWF, another SomaCore instance in a loaded SWF, and so on. But I'll give more details later.

You can now find the (updated) SomaCore resources on the SomaCore Page.

Special thanks to Henry for his testing and feedback!

Feel free to use the sources and give me some feedback. I'll try later to give more explanation on how to use SomaCore and the Wires, new demos and tutorials.

Romu

Vote in HexoSearch

Comments 1 Comment »