DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Construction Of Two-person Game
var file:FileReference = new FileReference();
stage.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
function onClick(evt:MouseEvent):void {
file.save("some text.\nsome more text", "actionsnippet.txt");
}
function showMsg(msg:String):void {
trace(msg);
}
showMsg("Claire");
stage.addEventListener(MouseEvent.CLICK, showMsg, false, 0, true);
function showMsg(evt:MouseEvent):void {
trace("hello");
}
Example of two-person games; <a href="http://www.freemanagementgames.com/play/tank-trouble.html">Tank Trouble</a>
stage.addEventListener(MouseEvent.CLICK, showMsg, "hello",
false, 0, true);
function showMsg(evt:MouseEvent, msg:String):void {
trace(msg);
}





