剪贴板或外部 *.txt 文件自动填充我的 URLRequest 需要哪一行代码?这是 as3 脚本,XXXXXX 在哪里我需要脚本自动从剪贴板获取文本并在执行之前放在那里,或者从 extern *.txt 文件中获取文本,放在那里并执行:
var request:URLRequest = new URLRequest("XXXXXX");
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
loader.contentLoaderInfo.addEventListener(Event.INIT, loadComplete);
loader.load(request);
function loadProgress(event:ProgressEvent):void {
var percentLoaded:Number = Math.ceil(event.bytesLoaded/event.bytesTotal);
trace("Loading: "+percentLoaded+"%");
}
function loadComplete(event:Event):void {
trace("Complete");
loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, loadProgress);
loader.contentLoaderInfo.removeEventListener(Event.INIT, loadComplete);
loader.x = 0;
loader.y = 0;
addChild(loader);
}