flex4.0實現翻書效果,並動態 使用FlexPaper顯示PDF文檔

由於項目需要,需要實現翻書效果,所以在網上找了一個翻書效果的源碼,自己有所改動,
這裏我的翻書效果要嵌套FlexPaperViewer,翻看的都是swf文件。

注,我的flex項目裏面需要兩個參數,參數的傳遞方法是在我調用的頁面寫入:
"/TestBook.html?hospitalcode="+id+"&swfcount="+swfcount , "_blank"
hospitalcode是swf文件名稱的前半部門,比如33_44.swf,33就爲hospitalcode.
swfcount是我的文件夾下有多少swf文件

然後在flex項目的TestBook.mxml頁面實現
private function setFlexPaperViewer():void
{
var args:Object = getParams();
var hospitalcode:String;
var swfcount:int;
if(args.hospitalcode != null ){
hospitalcode = args.hospitalcode;
//Alert.show(hospitalcode);
}
if(args.swfcount != null){
swfcount = args.swfcount
}
//Alert.show(swfcount.toString());

var array:Array = new Array();
for(var i:int = 1;i<=swfcount;i++)
{
var fpv:FlexPaperViewer = new FlexPaperViewer();
fpv.SwfFile="hospital/data/swf/"+hospitalcode+"_"+i+".swf";
array.push(fpv);
}
book.content = array;
currentPage.maximum = book.maximumPageIndex-1;
currentPage.minimum = book.minimumPageIndex+1;
}

由於比較大,所以只上傳了src
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章