Hi I'm trying to open a pdf from air on an android device, I'm using Flash CC to author it. The code I have works in the Air debug launcher but fails on the device. The PDF is included in the APK. Am I addressing the PDF correctly? Does
嗨,我想在Android設備上打開一個pdf,我正在使用Flash CC來創作它。我在Air調試啟動器中運行的代碼但在設備上失敗了。 PDF包含在APK中。我正確地處理了PDF嗎?是否
openWithDefaultApplication();
work on android?
在android上工作?
import flash.filesystem.*;
var thePDF = "poppinchicken.pdf";
var realFile:File = File.applicationDirectory.resolvePath(thePDF);
var destination:File = File.cacheDirectory;
destination = destination.resolvePath(thePDF);
realFile.copyTo(destination,true);
But01.addEventListener(MouseEvent.CLICK, outputbox7zz);
function outputbox7zz(e: MouseEvent): void {
destination.openWithDefaultApplication();
}
1 个解决方案
#1
1
Because the PDFs are hosted on the web I'm able to solve this simply for this project using
因為PDF是在Web上托管的,所以我只能使用這個項目來解決這個問題
var request: URLRequest = new URLRequest("http://www.hotnkickin.co.uk/mansion/pdf/chickenfillets.pdf");
navigateToURL(request);
This hasn't solved my original question but the result works for me in this instance, and so might help another new starter like me.
這並沒有解決我原來的問題,但結果在這個例子中對我有用,所以可能會幫助像我這樣的另一個新的首發。