Skip to content

Instantly share code, notes, and snippets.

@ktimothy
Created November 6, 2013 14:02
Show Gist options
  • Select an option

  • Save ktimothy/7336536 to your computer and use it in GitHub Desktop.

Select an option

Save ktimothy/7336536 to your computer and use it in GitHub Desktop.
as master strings
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.events.KeyboardEvent;
import flash.sampler.getMasterString;
/**
*
*/
public class TestMasterString extends Sprite
{
public function TestMasterString()
{
if(super.stage) this.init();
else
{super.addEventListener( Event.ADDED_TO_STAGE, init );}
}
private function init( event:Event = null ):void
{
super.removeEventListener( Event.ADDED_TO_STAGE, init );
super.stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
}
private function onKeyUp( event:KeyboardEvent ):void
{
var masterString:String = "mjfso8ifh9er8hf9384h9r893h48r983h4r98349hr9348hr9h3849r3489fh9herf9vnr";
var newString = masterString.substr(10,5);
trace(getMasterString(newString));
masterString = null;
trace(getMasterString(newString));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment