Skip to content

Instantly share code, notes, and snippets.

@darylducharme
darylducharme / Main.as
Created March 11, 2012 17:52
Testing why, when, and how of overriding AS3's event.clone() method
package
{
import flash.display.Sprite;
import flash.events.Event;
public class Main extends Sprite
{
private var _child1:Sprite;
private var _child2:Sprite;
private var _child3:Sprite;
@darylducharme
darylducharme / repeatString.as
Created March 9, 2012 17:01
Non loop way of creating a string of a certain length
/**
* Creates a string by repeating a string a certain number of times
* @param str The String to repeat
* @param count The number of times to repeat the string
*/
function repeatString(str:String, count:uint):String {
var output:Vector.<uint> = new Vector.<uint>(count, true);
return output.join("").replace(/0/g, str);
}