flexpaper 1.4.7 源码调试错误 (右键,和 不显示pdf文件状态) 已修复

下载官方的源码:

 

地址: http ://flexpaper.googlecode.com/svn/trunk/

 

我修改的是flex 3 版本的. 其实4也差不多.对应的修改就可以了

 

1. 源码部署需要修改相关参数. 根据你的实际flex sdk 环境有关.  如果没必要多语言支持.就全都删除了.只保留中文的FlexPaper.properties 即可. 放到src 根目录下

 

2. 设置flash player 为10.0.0 或以上.  这个是为了解决 运行示例程序出现 右键菜单不能访问clipboardMenu属性 和 unloadAndStop 方法的问题

 

3. 默认官方的源码是有点问题的.  他设置的加载swffile 时间不对. 照成了 一直是在加载文件状态.pdf 打不开的情况.

 

修改方式如下.:

 

  • FlexPaperViewer.mxml

 

<fp:Viewer id="paper1"	onDocumentLoaded="documentLoadedHandler(event)" 
			   onDocumentLoading="papersLoadingHandler(event)"
			   onDocumentLoadedError="documentLoadedErrorHandler(event)"
			   onLogoClicked="logoClickedEventHandler(event)"
			   
			   onNoMoreSearchResults="onNoMoreSearchResultsHandler(event)"
			   onLoadingProgress="onDocumentLoadingProgressHandler(event)"
			   onScaleChanged="onScaleChanged(event)"
			   onFitModeChanged="onFitModeChanged(event)"
			   onViewModeChanged="onViewModeChanged(event)"
			   onCurrPageChanged="onCurrPageChanged(event)"
			   onCursorModeChanged="onCursorModeChanged(event)"
			   onExternalLinkClicked="onExternalLinkClickedHandler(event)" 
			   onDocumentPrinted="documentPrintedHandler(event)"
			   onPageLoaded="pageLoadedEventHandler(event)"
			   onPageLoading="pageLoadingEventHandler(event)"
			   onErrorLoadingPage="errorLoadingPageEventHandler(event)"
			   
			   SwfFile="{SwfFile}"


			   Scale="{Scale}" 
			   ZoomTransition="{ZoomTransition}" 
			   ZoomTime="{ZoomTime}"
			   FitPageOnLoad="{FitPageOnLoad}"
			   FitWidthOnLoad="{FitWidthOnLoad}"
			   ProgressiveLoading="{ProgressiveLoading}"
			   ZoomInterval="{ZoomInterval}"
			   MinZoomSize="{MinZoomSize}"
			   MaxZoomSize="{MaxZoomSize}"
			   SearchMatchAll="{SearchMatchAll}"
			   SearchServiceUrl="{SearchServiceUrl}"
			   EncodeURI="{EncodeURI}"
			   AutoAdjustPrintSize="{AutoAdjustPrintSize}"
			   PrintPaperAsBitmap="{PrintPaperAsBitmap}"
			   
			   addedToStage="MacMouseWheelHandler.init(stage)" 
			   creationComplete="viewerCreationCompleteHandler(event)"

			   height="100%" width="100%" borderStyle="solid"  tabIndex="0" />	

 

SwfFile="{SwfFile}" 这个属性删除掉

增加 初始化完成事件

 

creationComplete="viewerCreationCompleteHandler(event)"

 

方法如下:

 

protected function viewerCreationCompleteHandler(event:FlexEvent):void
			{
				loadSwf(SwfFile);
				
			}

 

然后继续修改

 

 

  • FlexPaperViewer_Base.mxml 的 412 行左右的

 

public dynamic function loadSwf(s:String):void{
				viewer.SwfFile = s;
			}

 方法 改成

 

public dynamic function loadSwf(s:String):void{
				viewer.loadSwfFile(s);
			}

 

然后继续修改

 

  • Viewer.as 585行
public function set SwfFile(s:String):void {

 

改成

 

public function loadSwfFile(s:String):void { 

 

这样就可以在调用mxml 文件中这样写了:

 

<flexpaper:FlexPaperViewer id="flexview" width="100%" height="100%"   
							   Scale="0.95" SwfFile="http://localhost:8080/PdfView/view/Paper.swf" />
 

或者 手动加载文件

 

flexview.loadSwf("http://localhost:8080/PdfView/view/Paper.swf");

 都可以显示了

 

如图:


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值