1  /**
     2   * com.sekati.effects.Typo
     3   * @version 1.0.0
     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  /**
    10   * Typo Text Effects
    11   */
    12  class com.sekati.effects.Typo {
    13  
    14  	/**
    15  	 * Generate a set of random characters
    16  	 * @param x (Number) of characters to generate
    17  	 * @param n (Boolean) character set
    18  	 * @return String
    19  	 */
    20  	private static function genChars(x:Number,n:Boolean):String {
    21  		var str:String = "";
    22  		var sc:Number,ec:Number;
    23  		if(n == true) { 
    24  			sc = 33; 
    25  			ec = 64; 
    26  		} else { 
    27  			sc = 33; 
    28  			ec = 126; 
    29  		}	
    30  		for(var i:Number = 0; i < x ; i++) { 
    31  			str += chr( Math.round( Math.random( ) * (ec - sc) ) + sc ); 
    32  		}
    33  		return str;
    34  	}
    35  
    36  	/**
    37  	 * Detect spaces in one string and insert them into the other
    38  	 * @param s1 (String) pull spaces from
    39  	 * @param s2 (String) insert spaces in to
    40  	 * @return String
    41  	 * {@code Usage:
    42  	 * 	var foobar:String = Typo.commonSpace("Foo Foo Foo", "Bar*Bar*Bar"); // returns "Bar Bar Bar"
    43  	 * }
    44  	 */
    45  	private static function commonSpace(s1:String,s2:String):String {
    46  		var str:String = "";
    47  		for (var i:Number = 0; i < s2.length ; i++) {
    48  			str += (s1.charAt( i ) == " ") ? " " : s2.charAt( i );
    49  		}
    50  		return str;
    51  	}
    52  
    53  	public static function writein():Void {
    54  	}
    55  
    56  	public static function writeout():Void {
    57  	}	
    58  
    59  	private function Typo() {
    60  	}
    61  }