1  /**
     2   * com.sekati.core.Document
     3   * @version 1.0.5
     4   * @author jason m horwitz | sekati.com
     5   * Copyright (C) 2007  jason m horwitz, Sekat LLC. All Rights Reserved.
     6   * Released under the MIT License: http://www.opensource.org/licenses/mit-license.php
     7   */
     8  
     9  import com.project.core.Bootstrap;
    10  import com.sekati.display.BaseClip;
    11  import com.sekati.log.Logger;
    12  import caurina.transitions.properties.*;
    13  
    14  /**
    15   * Document controller simulates an AS3 DocumentClass
    16   * {@code Usage on first _root frame:
    17   * Document.main(this);
    18   * }
    19   * @see {@link com.sekati.core.App}
    20   */
    21  class com.project.core.Document extends BaseClip {
    22  
    23  	public var log:Logger;
    24  	private var bootstrap:Bootstrap;
    25  
    26  	/**
    27  	 * Constructor
    28  	 */
    29  	private function Document() {
    30  		super( );
    31  		init( );
    32  	}
    33  
    34  	/**
    35  	 * Link the Document class to the _root timeline via constructor simulating an AS3 document class.
    36  	 * @param target (MovieClip)
    37  	 * @return Void
    38  	 */
    39  	public static function main(target:MovieClip):Void {
    40  		target.__proto__ = Document.prototype;
    41  		Function( Document ).apply( target, null );
    42  	}
    43  
    44  	/**
    45  	 * General movie setup and class compositions.
    46  	 * @return Void
    47  	 */
    48  	private function init():Void {
    49  		setMovieProps( );
    50  		buildCompositions( );
    51  	}
    52  
    53  	/**
    54  	 * general movie setup
    55  	 * @return Void
    56  	 */
    57  	private function setMovieProps():Void {
    58  		//trace( "*** Setting Movie Properties ..." );
    59  		System.security.allowInsecureDomain( "*" );
    60  		System.security.allowDomain( "*" );
    61  		fscommand( "swLiveConnect", "true" );
    62  		fscommand( "allowscale", "false" );
    63  		fscommand( "showmenu", "false" );
    64  		fscommand( "fullscreen", "false" );
    65  		Stage.align = "TL";
    66  		Stage.scaleMode = "noScale";
    67  		_quality = "HIGH";
    68  		_focusrect = false;
    69  	}
    70  
    71  	/**
    72  	 * centralize class compositions for core functionalities (Stage, ContextMenu, misc Managers)
    73  	 * @return Void
    74  	 */
    75  	private function buildCompositions():Void {
    76  		trace( "*** - Document Initialized ..." );
    77  		bootstrap = new Bootstrap( );
    78  		
    79  		log = Logger.getInstance( );
    80  		log.isIDE = true;
    81  		log.isLC = true;
    82  		log.isSWF = false;
    83  		
    84  		// Tweener initialization ...
    85  		FilterShortcuts.init( );
    86  		ColorShortcuts.init( );
    87  		DisplayShortcuts.init( );
    88  		TextShortcuts.init( );
    89  		SoundShortcuts.init( );	
    90  	}
    91  }