<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://wbex.ru/index.php?action=history&amp;feed=atom&amp;title=Flash_%2F_Flex_%2F_ActionScript%2FDevelopment%2FTrace_Utilities</id>
		<title>Flash / Flex / ActionScript/Development/Trace Utilities - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://wbex.ru/index.php?action=history&amp;feed=atom&amp;title=Flash_%2F_Flex_%2F_ActionScript%2FDevelopment%2FTrace_Utilities"/>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=Flash_/_Flex_/_ActionScript/Development/Trace_Utilities&amp;action=history"/>
		<updated>2026-04-04T07:17:56Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://wbex.ru/index.php?title=Flash_/_Flex_/_ActionScript/Development/Trace_Utilities&amp;diff=4540&amp;oldid=prev</id>
		<title> в 09:19, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=Flash_/_Flex_/_ActionScript/Development/Trace_Utilities&amp;diff=4540&amp;oldid=prev"/>
				<updated>2010-05-26T09:19:12Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 09:19, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://wbex.ru/index.php?title=Flash_/_Flex_/_ActionScript/Development/Trace_Utilities&amp;diff=4541&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=Flash_/_Flex_/_ActionScript/Development/Trace_Utilities&amp;diff=4541&amp;oldid=prev"/>
				<updated>2010-05-26T08:14:59Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Sends trace actions to the Alcon output panel through a local connection==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
/*&lt;br /&gt;
 * hexagon framework - Multi-Purpose ActionScript 3 Framework.&lt;br /&gt;
 * Copyright (C) 2007 Hexagon Star Softworks&lt;br /&gt;
 *       __    __&lt;br /&gt;
 *    __/  \__/  \__    __&lt;br /&gt;
 *   /  \__/HEXAGON \__/  \&lt;br /&gt;
 *   \__/  \__/ FRAMEWORK_/&lt;br /&gt;
 *            \__/  \__/&lt;br /&gt;
 *&lt;br /&gt;
 * ``The contents of this file are subject to the Mozilla Public License&lt;br /&gt;
 * Version 1.1 (the &amp;quot;License&amp;quot;); you may not use this file except in&lt;br /&gt;
 * compliance with the License. You may obtain a copy of the License at&lt;br /&gt;
 * http://www.mozilla.org/MPL/&lt;br /&gt;
 *&lt;br /&gt;
 * Software distributed under the License is distributed on an &amp;quot;AS IS&amp;quot;&lt;br /&gt;
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the&lt;br /&gt;
 * License for the specific language governing rights and limitations&lt;br /&gt;
 * under the License.&lt;br /&gt;
 */&lt;br /&gt;
package com.hexagonstar.util.debug&lt;br /&gt;
{&lt;br /&gt;
  import flash.display.Stage;&lt;br /&gt;
  import flash.events.Event;&lt;br /&gt;
  import flash.events.NetStatusEvent;&lt;br /&gt;
  import flash.events.StatusEvent;&lt;br /&gt;
  import flash.net.LocalConnection;&lt;br /&gt;
  import flash.net.SharedObject;&lt;br /&gt;
  import flash.net.SharedObjectFlushStatus;&lt;br /&gt;
  import flash.system.Security;&lt;br /&gt;
  import flash.system.SecurityPanel;&lt;br /&gt;
  import flash.system.System;&lt;br /&gt;
  import flash.utils.ByteArray;&lt;br /&gt;
  &lt;br /&gt;
  /**&lt;br /&gt;
   * Alcon Debug class (AS 3.0 version)&lt;br /&gt;
   * Sends trace actions to the Alcon output panel through a local connection.&lt;br /&gt;
   * &lt;br /&gt;
   * @version 2.0.1 (2007.03.26)&lt;br /&gt;
   */&lt;br /&gt;
  public final class Debug&lt;br /&gt;
  {&lt;br /&gt;
    // Constants //////////////////////////////////////////////////////////////////&lt;br /&gt;
    &lt;br /&gt;
    public static const LEVEL_DEBUG:uint  = 0;&lt;br /&gt;
    public static const LEVEL_INFO:uint  = 1;&lt;br /&gt;
    public static const LEVEL_WARN:uint  = 2;&lt;br /&gt;
    public static const LEVEL_ERROR:uint  = 3;&lt;br /&gt;
    public static const LEVEL_FATAL:uint  = 4;&lt;br /&gt;
    &lt;br /&gt;
    // Properties /////////////////////////////////////////////////////////////////&lt;br /&gt;
    &lt;br /&gt;
    private static var _fpsPollInterval:uint  = 1000;&lt;br /&gt;
    private static var _filterLevel:uint    = 0;&lt;br /&gt;
    &lt;br /&gt;
    private static var _isConnected:Boolean  = false;&lt;br /&gt;
    private static var _isPollingFPS:Boolean  = false;&lt;br /&gt;
    private static var _isDisabled:Boolean  = false;&lt;br /&gt;
    private static var _isLargeData:Boolean  = false;&lt;br /&gt;
    &lt;br /&gt;
    private static var _connection:LocalConnection;&lt;br /&gt;
    private static var _stopWatch:StopWatch;&lt;br /&gt;
    private static var _fpsMeter:FPSMeter;&lt;br /&gt;
    private static var _stage:Stage;&lt;br /&gt;
    &lt;br /&gt;
    // Constructor ////////////////////////////////////////////////////////////////&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Internal Constructor&lt;br /&gt;
     */&lt;br /&gt;
    function Debug()&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Public Methods /////////////////////////////////////////////////////////////&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * The trace method accepts three arguments, the first contains the data which&lt;br /&gt;
     * is going to be traced, the second if of type Boolean is used to indicate&lt;br /&gt;
     * recursive object tracing mode, if of type int desribes the filtering level&lt;br /&gt;
     * for the output.&lt;br /&gt;
     * &lt;br /&gt;
     * @param arg0 The object to be traced (defaults to undefined).&lt;br /&gt;
     * @param arg1 True if recursive object tracing, optional (defaults to null).&lt;br /&gt;
     * @param arg2 Output level, optional, defaults to 1.&lt;br /&gt;
     */&lt;br /&gt;
    public static function trace(arg0:* = undefined, arg1:* = null, arg2:int = -1):void&lt;br /&gt;
    {&lt;br /&gt;
      var data:* = arg0;&lt;br /&gt;
      var recursive:Boolean = false;&lt;br /&gt;
      var level:int = 1;&lt;br /&gt;
      &lt;br /&gt;
      // Check if argument 1 is a boolean or a number:&lt;br /&gt;
      if (typeof(arg1) == &amp;quot;boolean&amp;quot;)&lt;br /&gt;
      {&lt;br /&gt;
        recursive = arg1;&lt;br /&gt;
      }&lt;br /&gt;
      else if (typeof(arg1) == &amp;quot;number&amp;quot;)&lt;br /&gt;
      {&lt;br /&gt;
        level = arg1;&lt;br /&gt;
      }&lt;br /&gt;
      if (arg2 &amp;gt; -1)&lt;br /&gt;
      {&lt;br /&gt;
        level = arg2;&lt;br /&gt;
      }&lt;br /&gt;
      &lt;br /&gt;
      // Only show messages equal or higher than current filter level:&lt;br /&gt;
      if (level &amp;gt;= _filterLevel &amp;amp;&amp;amp; level &amp;lt; 7)&lt;br /&gt;
      {&lt;br /&gt;
        // Send the data to the output console:&lt;br /&gt;
        send(&amp;quot;onData&amp;quot;, data, level, ((recursive) ? 1 : 0));&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Can be used to inspect the specified object. This method sends the object&lt;br /&gt;
     * to the Alcon output panel where it is displayed in the Inspect tab.&lt;br /&gt;
     * &lt;br /&gt;
     * @param object The object to be inspected.&lt;br /&gt;
     * @param depth The depth with that to inspect the object. If this argument&lt;br /&gt;
     * is -1 or omitted, the default from Alcon&amp;quot;s config file will be used.&lt;br /&gt;
     */&lt;br /&gt;
    public static function inspect(object:Object = null, depth:int = -1):void&lt;br /&gt;
    {&lt;br /&gt;
      send(&amp;quot;onInspect&amp;quot;, object, 1, depth);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Outputs a hexadecimal dump of the specified object.&lt;br /&gt;
     * &lt;br /&gt;
     * @param object The object of which to output a hex dump.&lt;br /&gt;
     */&lt;br /&gt;
    public static function hexDump(object:*):void&lt;br /&gt;
    {&lt;br /&gt;
      send(&amp;quot;onHexDump&amp;quot;, object, 0, 0);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Forces an immediate Garbage Collector mark/sweep. Use with caution!&lt;br /&gt;
     * This method is not officially supported by the Flash Player!&lt;br /&gt;
     */&lt;br /&gt;
    public static function forceGC():void&lt;br /&gt;
    {&lt;br /&gt;
      try&lt;br /&gt;
      {&lt;br /&gt;
        new LocalConnection().connect(&amp;quot;forceGC&amp;quot;);&lt;br /&gt;
        new LocalConnection().connect(&amp;quot;forceGC&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
      catch (e:Error)&lt;br /&gt;
      {&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Sends a clear buffer signal to the output console. The Trace tab will be&lt;br /&gt;
     * cleared after this signal is received.&lt;br /&gt;
     */&lt;br /&gt;
    public static function clear():void&lt;br /&gt;
    {&lt;br /&gt;
      Debug.trace(&amp;quot;[%CLR%]&amp;quot;, 5);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Sends a delimiter signal to the output console.&lt;br /&gt;
     */&lt;br /&gt;
    public static function delimiter():void&lt;br /&gt;
    {&lt;br /&gt;
      Debug.trace(&amp;quot;[%DLT%]&amp;quot;, 5);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Sends a pause signal to the output console.&lt;br /&gt;
     */&lt;br /&gt;
    public static function pause():void&lt;br /&gt;
    {&lt;br /&gt;
      Debug.trace(&amp;quot;[%PSE%]&amp;quot;, 5);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Sends a time/date signal to the output console.&lt;br /&gt;
     */&lt;br /&gt;
    public static function time():void&lt;br /&gt;
    {&lt;br /&gt;
      Debug.trace(&amp;quot;[%TME%]&amp;quot;, 5);&lt;br /&gt;
    }&lt;br /&gt;
  &lt;br /&gt;
    /**&lt;br /&gt;
     * Sets the current logging filter level.&lt;br /&gt;
     * &lt;br /&gt;
     * @param level A value for the filter level to be set. If no argument&lt;br /&gt;
     *              is specified, 0 is used as default.&lt;br /&gt;
     */&lt;br /&gt;
    public static function setFilterLevel(level:uint = 0):void&lt;br /&gt;
    {&lt;br /&gt;
      if (level &amp;gt;= 0 &amp;amp;&amp;amp; level &amp;lt; 5) _filterLevel = level;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Returns the currently used logging filter level.&lt;br /&gt;
     * &lt;br /&gt;
     * @return The current filter level.&lt;br /&gt;
     */&lt;br /&gt;
    public static function getFilterLevel():int&lt;br /&gt;
    {&lt;br /&gt;
      return _filterLevel;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Disables the output coming from the Debug class. This can be used&lt;br /&gt;
     * to quickly suppress all debug output without needing to remove&lt;br /&gt;
     * function calls to the Debug class and it&amp;quot;s imports.&lt;br /&gt;
     */&lt;br /&gt;
    public static function disable():void&lt;br /&gt;
    {&lt;br /&gt;
      _isDisabled = true;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // FPS Polling Methods ////////////////////////////////////////////////////////&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * When called starts measuring the current host applications frames per&lt;br /&gt;
     * second and sends the FPS value and the current amount of memory used by&lt;br /&gt;
     * the host applications Flash Player to the Alcon output console.&lt;br /&gt;
     * &lt;br /&gt;
     * @param stage The Stage of the current host application.&lt;br /&gt;
     */&lt;br /&gt;
    public static function fpsStart(stage:Stage):void&lt;br /&gt;
    {&lt;br /&gt;
      if (!_isDisabled &amp;amp;&amp;amp; _fpsMeter == null)&lt;br /&gt;
      {&lt;br /&gt;
        _isPollingFPS = true;&lt;br /&gt;
        _stage = stage;&lt;br /&gt;
        _fpsMeter = new FPSMeter(stage);&lt;br /&gt;
        _fpsMeter.addEventListener(FPSMeter.FPS_UPDATE, onFPSUpdate);&lt;br /&gt;
        _fpsMeter.start();&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Stops the FPS polling.&lt;br /&gt;
     */&lt;br /&gt;
    public static function fpsStop():void&lt;br /&gt;
    {&lt;br /&gt;
      if (_fpsMeter != null)&lt;br /&gt;
      {&lt;br /&gt;
        _isPollingFPS = false;&lt;br /&gt;
        _fpsMeter.stop();&lt;br /&gt;
        _fpsMeter.removeEventListener(FPSMeter.FPS_UPDATE, onFPSUpdate);&lt;br /&gt;
        _fpsMeter = null;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Timer Methods //////////////////////////////////////////////////////////////&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Starts the Stowatch to measure a time amount.&lt;br /&gt;
     */&lt;br /&gt;
    public static function timerStart(title:String = &amp;quot;&amp;quot;):void&lt;br /&gt;
    {&lt;br /&gt;
      if (!_isDisabled)&lt;br /&gt;
      {&lt;br /&gt;
        if (_stopWatch == null) _stopWatch = new StopWatch();&lt;br /&gt;
        _stopWatch.start(title);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Stops the Stowatch.&lt;br /&gt;
     */&lt;br /&gt;
    public static function timerStop():void&lt;br /&gt;
    {&lt;br /&gt;
      if (_stopWatch != null) _stopWatch.stop();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Resets the Stopwatch.&lt;br /&gt;
     */&lt;br /&gt;
    public static function timerReset():void&lt;br /&gt;
    {&lt;br /&gt;
      if (_stopWatch != null) _stopWatch.reset();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Sends the measured time in milliseconds to the output console.&lt;br /&gt;
     */&lt;br /&gt;
    public static function timerMilliSeconds():void&lt;br /&gt;
    {&lt;br /&gt;
      if (_stopWatch != null) Debug.trace(_stopWatch.getTimeInMilliSeconds() + &amp;quot;ms&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Sends the measured time in seconds to the output console.&lt;br /&gt;
     */&lt;br /&gt;
    public static function timerSeconds():void&lt;br /&gt;
    {&lt;br /&gt;
      if (_stopWatch != null) Debug.trace(_stopWatch.getTimeInSeconds() + &amp;quot;s&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Sends the measured time to the output console. This automatically&lt;br /&gt;
     * formats the values to seconds and milliseconds.&lt;br /&gt;
     */&lt;br /&gt;
    public static function timerToString():void&lt;br /&gt;
    {&lt;br /&gt;
      if (_stopWatch != null) Debug.trace(_stopWatch.toString());&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Stops the Stopwatch and immediately Sends the measured time to the&lt;br /&gt;
     * output console in the same manner like timerToString().&lt;br /&gt;
     * &lt;br /&gt;
     * @param reset If true resets the Timer after the result has been output.&lt;br /&gt;
     */&lt;br /&gt;
    public static function timerStopToString(reset:Boolean = false):void&lt;br /&gt;
    {&lt;br /&gt;
      if (_stopWatch != null)&lt;br /&gt;
      {&lt;br /&gt;
        _stopWatch.stop();&lt;br /&gt;
        Debug.trace(_stopWatch.toString());&lt;br /&gt;
        if (reset) _stopWatch.reset();&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Private Methods ////////////////////////////////////////////////////////////&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Sends the specified data.&lt;br /&gt;
     * &lt;br /&gt;
     * @private&lt;br /&gt;
     */&lt;br /&gt;
    private static function send(method:String, data:*, level:int = 1, rec:uint = 0):void&lt;br /&gt;
    {&lt;br /&gt;
      // Only send if Debug is not disabled:&lt;br /&gt;
      if (!_isDisabled)&lt;br /&gt;
      {&lt;br /&gt;
        // Establish connection if not already done:&lt;br /&gt;
        if (!_isConnected)&lt;br /&gt;
        {&lt;br /&gt;
          _isConnected = true;&lt;br /&gt;
          _connection = new LocalConnection();&lt;br /&gt;
          _connection.addEventListener(StatusEvent.STATUS, onStatus);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Get the size of the data:&lt;br /&gt;
        var size:uint = 0;&lt;br /&gt;
        if (typeof(data) == &amp;quot;string&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
          size = String(data).length;&lt;br /&gt;
        }&lt;br /&gt;
        else if (typeof(data) == &amp;quot;object&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
          var byteArray:ByteArray = new ByteArray();&lt;br /&gt;
          byteArray.writeObject(data);&lt;br /&gt;
          size = byteArray.length;&lt;br /&gt;
          byteArray = null;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If the data size exceeds 39Kb, use a LSO instead:&lt;br /&gt;
        if (size &amp;gt; 39000)&lt;br /&gt;
        {&lt;br /&gt;
          storeDataLSO(method, data);&lt;br /&gt;
          method = &amp;quot;onLargeData&amp;quot;;&lt;br /&gt;
          data = null;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        _connection.send(&amp;quot;_alcon_lc&amp;quot;, method, data, level, rec, &amp;quot;&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Stores data larger than 40Kb to a Local Shared Object.&lt;br /&gt;
     * &lt;br /&gt;
     * @private&lt;br /&gt;
     */&lt;br /&gt;
    private static function storeDataLSO(method:String, data:*):void&lt;br /&gt;
    {&lt;br /&gt;
      var sharedObject:SharedObject = SharedObject.getLocal(&amp;quot;alcon&amp;quot;, &amp;quot;/&amp;quot;);&lt;br /&gt;
      sharedObject.data.alconMethod = method;&lt;br /&gt;
      sharedObject.data.alconData = data;&lt;br /&gt;
      try&lt;br /&gt;
      {&lt;br /&gt;
        var flushResult:String = sharedObject.flush();&lt;br /&gt;
        if (flushResult == SharedObjectFlushStatus.FLUSHED)&lt;br /&gt;
        {&lt;br /&gt;
          return;&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
      catch (e:Error)&lt;br /&gt;
      {&lt;br /&gt;
        Security.showSettings(SecurityPanel.LOCAL_STORAGE);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Called on every fpsUpdate event.&lt;br /&gt;
     * &lt;br /&gt;
     * @private&lt;br /&gt;
     */&lt;br /&gt;
    private static function onFPSUpdate(event:Event):void&lt;br /&gt;
    {&lt;br /&gt;
      send(&amp;quot;onFPS&amp;quot;, (_fpsMeter.getFPS() + &amp;quot;/&amp;quot; + _stage.frameRate + &amp;quot;|&amp;quot; + System.totalMemory));&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * onStatus method&lt;br /&gt;
     * &lt;br /&gt;
     * @private&lt;br /&gt;
     */&lt;br /&gt;
    private static function onStatus(event:StatusEvent):void&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
        &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Stopwatch==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
/*&lt;br /&gt;
 * hexagon framework - Multi-Purpose ActionScript 3 Framework.&lt;br /&gt;
 * Copyright (C) 2007 Hexagon Star Softworks&lt;br /&gt;
 *       __    __&lt;br /&gt;
 *    __/  \__/  \__    __&lt;br /&gt;
 *   /  \__/HEXAGON \__/  \&lt;br /&gt;
 *   \__/  \__/ FRAMEWORK_/&lt;br /&gt;
 *            \__/  \__/&lt;br /&gt;
 *&lt;br /&gt;
 * ``The contents of this file are subject to the Mozilla Public License&lt;br /&gt;
 * Version 1.1 (the &amp;quot;License&amp;quot;); you may not use this file except in&lt;br /&gt;
 * compliance with the License. You may obtain a copy of the License at&lt;br /&gt;
 * http://www.mozilla.org/MPL/&lt;br /&gt;
 *&lt;br /&gt;
 * Software distributed under the License is distributed on an &amp;quot;AS IS&amp;quot;&lt;br /&gt;
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the&lt;br /&gt;
 * License for the specific language governing rights and limitations&lt;br /&gt;
 * under the License.&lt;br /&gt;
 */&lt;br /&gt;
package com.hexagonstar.util.debug&lt;br /&gt;
{&lt;br /&gt;
  import flash.utils.getTimer;&lt;br /&gt;
  &lt;br /&gt;
  /**&lt;br /&gt;
   * Stopwatch stops the time.&lt;br /&gt;
   * &lt;br /&gt;
   * Instantiate this class as follows:&lt;br /&gt;
   *   import com.hexagonstar.util.StopWatch;&lt;br /&gt;
   *   var stopWatch:StopWatch = new StopWatch();&lt;br /&gt;
   * &lt;br /&gt;
   * This will create a still standing stopwatch. You can start&lt;br /&gt;
   * and stop the stopwatch to record time as you please.&lt;br /&gt;
   *   stopWatch.start();&lt;br /&gt;
   *   // Do something&lt;br /&gt;
   *   stopWatch.stop();&lt;br /&gt;
   * &lt;br /&gt;
   * The recored time is available in milliseconds and seconds.&lt;br /&gt;
   *   trace(stopWatch.getTimeInMilliSeconds() + &amp;quot; ms&amp;quot;);&lt;br /&gt;
   *   trace(stopWatch.getTimeInSeconds() + &amp;quot; s&amp;quot;);&lt;br /&gt;
   * &lt;br /&gt;
   */&lt;br /&gt;
  public class StopWatch&lt;br /&gt;
  {&lt;br /&gt;
    private var _started:Boolean = false;&lt;br /&gt;
    private var _startTimeKeys:Array;&lt;br /&gt;
    private var _stopTimeKeys:Array;&lt;br /&gt;
    private var _title:String;&lt;br /&gt;
    &lt;br /&gt;
    /** &lt;br /&gt;
     * Constructs a new StopWatch instance.&lt;br /&gt;
     */&lt;br /&gt;
    public function StopWatch()&lt;br /&gt;
    {&lt;br /&gt;
      reset();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Resets the stopwatch total running time.&lt;br /&gt;
     */&lt;br /&gt;
    public function reset():void&lt;br /&gt;
    {&lt;br /&gt;
      _startTimeKeys = new Array();&lt;br /&gt;
      _stopTimeKeys = new Array();&lt;br /&gt;
      _started = false;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Starts the time recording process.&lt;br /&gt;
     */&lt;br /&gt;
    public function start(title:String = &amp;quot;&amp;quot;):void&lt;br /&gt;
    {&lt;br /&gt;
      if (!hasStarted())&lt;br /&gt;
      {&lt;br /&gt;
        _title = title;&lt;br /&gt;
        _started = true;&lt;br /&gt;
        _startTimeKeys.push(getTimer());&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Stops the time recording process if the process has been started before.&lt;br /&gt;
     */&lt;br /&gt;
    public function stop():void&lt;br /&gt;
    {&lt;br /&gt;
      if (hasStarted())&lt;br /&gt;
      {&lt;br /&gt;
        var stopTime:uint = getTimer();&lt;br /&gt;
        _stopTimeKeys[_startTimeKeys.length - 1] = stopTime;&lt;br /&gt;
        _started = false;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Returns whether this stopwatch has been started.&lt;br /&gt;
     * &lt;br /&gt;
     * @return           true if this stopwatch has been started else false.&lt;br /&gt;
     */&lt;br /&gt;
    public function hasStarted():Boolean&lt;br /&gt;
    {&lt;br /&gt;
      return _started;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Calculates and returns the elapsed time in milliseconds.&lt;br /&gt;
     * This stopwatch will not be stopped by calling this method. If this stopwatch&lt;br /&gt;
     * is still running it takes the current time as stoptime for the result.&lt;br /&gt;
     * &lt;br /&gt;
     * @return           the elapsed time in milliseconds.&lt;br /&gt;
     */&lt;br /&gt;
    public function getTimeInMilliSeconds():int&lt;br /&gt;
    {&lt;br /&gt;
      if (hasStarted())&lt;br /&gt;
      {&lt;br /&gt;
        _stopTimeKeys[_startTimeKeys.length - 1] = getTimer();&lt;br /&gt;
      }&lt;br /&gt;
      var result:int = 0;&lt;br /&gt;
      for (var i:int = 0; i &amp;lt; _startTimeKeys.length; i++)&lt;br /&gt;
      {&lt;br /&gt;
        result += (_stopTimeKeys[i] - _startTimeKeys[i]);&lt;br /&gt;
      }&lt;br /&gt;
      return result;    &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Calculates and returns the elapsed time in seconds.&lt;br /&gt;
     * This stopwatch will not be stopped by calling this method. If this stopwatch&lt;br /&gt;
     * is still running it takes the current time as stoptime for the result.&lt;br /&gt;
     * &lt;br /&gt;
     * @return           the elapsed time in seconds.&lt;br /&gt;
     */&lt;br /&gt;
    public function getTimeInSeconds():Number&lt;br /&gt;
    {&lt;br /&gt;
      return getTimeInMilliSeconds() / 1000;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Generates a string representation of this stopwatch that includes all start and&lt;br /&gt;
     * stop times in milliseconds.&lt;br /&gt;
     * &lt;br /&gt;
     * @return           the string representation of this stopwatch.&lt;br /&gt;
     */&lt;br /&gt;
    public function toString():String&lt;br /&gt;
    {&lt;br /&gt;
      var result:String = &amp;quot;\n ********** [STOPWATCH] **********&amp;quot;;&lt;br /&gt;
      if (_title != &amp;quot;&amp;quot;) result += &amp;quot;\n  &amp;quot; + _title;&lt;br /&gt;
      for(var i:int = 0; i &amp;lt; _startTimeKeys.length; i++)&lt;br /&gt;
      {&lt;br /&gt;
        result += &amp;quot;\n  started [&amp;quot; + _startTimeKeys[i]&lt;br /&gt;
          + &amp;quot;ms] stopped [&amp;quot; + _stopTimeKeys[i] + &amp;quot;ms]&amp;quot;;&lt;br /&gt;
      }&lt;br /&gt;
      if (i == 0) result += &amp;quot;\n  never started.&amp;quot;;&lt;br /&gt;
      else result += &amp;quot;\n  total runnning time: &amp;quot; + getTimeInMilliSeconds() + &amp;quot;ms&amp;quot;;&lt;br /&gt;
      result += &amp;quot;\n *********************************&amp;quot;;&lt;br /&gt;
      return result;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
        &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>