ActionScript 3 AIR:加载PDF

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ActionScript 3 AIR:加载PDF相关的知识,希望对你有一定的参考价值。

package src{
	import flash.display.LoaderInfo;
	import flash.display.Sprite;
	import flash.display.Stage;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.*;
	import flash.html.HTMLLoader;
	import flash.html.HTMLPDFCapability;
	import flash.net.URLRequest;

	public class PDFLoader extends Sprite
	{
		private var appStage:Stage;
		private var pdfLoader:HTMLLoader;
		private var assetResolverURL:String = "book.pdf";
		
		public function PDFLoader()
		{
			appStage = stage;
			appStage.scaleMode = StageScaleMode.NO_SCALE;
			appStage.align = StageAlign.TOP_LEFT;
			
			if (HTMLLoader.pdfCapability == HTMLPDFCapability.STATUS_OK){
				pdfLoader = new HTMLLoader();
				pdfLoader.x = appStage.x;
				pdfLoader.y = appStage.y;
				pdfLoader.width = appStage.width;
				pdfLoader.height = appStage.height;
				pdfLoader.addEventListener( Event.COMPLETE, onPDFComplete );
				pdfLoader.addEventListener(ProgressEvent.PROGRESS, onPDFProgress, false, 0, true);
				pdfLoader.load( new URLRequest( assetResolverURL ) );
				addChild( pdfLoader );
			}
			
		}

		private function getFlashVars():Object
		{
		     return Object( LoaderInfo( this.loaderInfo ).parameters );
		}
		
		private function onPDFProgress( e:Event ):void
		{
		}
		
		private function onPDFComplete( e:Event ):void
		{
			
		}

	}
}

以上是关于ActionScript 3 AIR:加载PDF的主要内容,如果未能解决你的问题,请参考以下文章

ActionScript 3 AIR — 视频使眨眼跳跃

重叠声音 Actionscript 3/AIR

ActionScript 3 AIR ActiveRecord是开源的

ActionScript 3 忽略AIR中的隐藏文件

ActionScript 3 Adobe AIR URLMonitor示例

ActionScript 3 [AIR] [FlashBuilder] Webbrowser