actionscript 3 - Open document function in Windows 7 with AIR App -
below code i'm working on open pdf file when button clicked.
works fine in windows vista , windows 8+, pdf file gets opened once in windows 7.
by clicking button again doesn't launch pdf file second time.
function opendoc(event: mouseevent): void { nsstream.pause(); pausedbtn.visible = true; mcvideocontrols.btnpause.visible = false; mcvideocontrols.btnplay.visible = true; var realfile: file = file.applicationdirectory.resolvepath(_myfilename); //get user's home directory: var destination: file = file.documentsdirectory; //copy original file temponary user's home directory: destination = destination.resolvepath(_myfilename); realfile.copyto(destination, true); //open temponary copy user's home directory (acrobat or whatever): destination.openwithdefaultapplication(); } function oncuepoint(infoobject:object):void { opendocbtn.visible = true; timer1.start(); if (infoobject.name == "mydoccue"){ _myfilename = "mydoc.pdf"; // = filename }
Comments
Post a Comment