AS 3 projector open pdf using fscommand

I'm tasked to create a CD with a projector file that launches. The main function of this exe is to open various PDFs on the CD in Acrobat.

I've tried the following:
fscommand("exec","CH1.pdf");
fscommand("exec","cmd.exe /C start CH1.pdf");

I have pdf files in the root directory with the projector file as well as a sub directory called 'fscommand'.

I am getting no errors or response when the buttons are clicked.
LVL 2
saic_gcoAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CyanBlueCommented:
You cannot execute the PDF file like you have the first line...  The second line does not work because fscommand exec won't work with any command that has space hence you cannot pass any argument to the cmd.exe...

The solution would be creating a batch file with that cmd.exe line and execute the batch file with fscommand exec command...  That batch file should be placed into the fscommand directory...

CyanBlue
saic_gcoAuthor Commented:
wouldnt the call for a batch file require a space aswell? or would i need a bat file for each pdf?
CyanBlueCommented:
You need a batch file per PDF file...

CyanBlue
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

saic_gcoAuthor Commented:
Ok function now calls:

fscommand("exec", "start.bat");

Place start.bat in my fscommand directory:
exec CH1.pdf

I double clicked the bat file and it works fine, however still not working in the test movie or published projector movie.
saic_gcoAuthor Commented:
// add on click listeners to buttons
ch1.addEventListener(MouseEvent.CLICK, callPDF);

// function to call pdf
function callPDF(e:Event) {
      try {
            fscommand("exec", "start.bat");
      } catch (e:Error) {
            trace("Error occurred!");
      }
}
CyanBlueCommented:
I think the batch file should be saying this...
   start CH1.pdf

You might also want to take a look at this page...
   http://www.northcode.com/blog.php/2007/08/07/Conquering-FSCommand-EXEC-Part-1-Proxy

CyanBlue

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
saic_gcoAuthor Commented:
I thumbed exec in there, it indeed is: start CH1.pdf

reading your link I found the culprit:

"Update One additional restriction you will have to deal with is the fact that Flash 9 projectors can't launch BAT files on Windows 2000, XP and Vista."

As I am on XP; and potentially many of the users will be using XP or Vista. Therefore its back to using navigateToURL or finding an alternative to bat files. It is not opening the pdfs directly, eg:

fscommand("exec", "CH1.pdf");
CyanBlueCommented:
I do not have an access to the Windows machine at the moment...  I'll check to see if I can create a sample for you...

CyanBlue
CyanBlueCommented:
Oh, what is the version of Flash IDE and the version of ActionScript you are using???

CyanBlue
saic_gcoAuthor Commented:
CS3 and AS 3.0, I'm currently trying to get it working using AS 2.0 but no luck. When I double click the proxy.exe file I get the "Security Warning" which is what I assume is breaking it. However after copying the file the warning no longer shows, but it is still not working.

What a headache! Thanks for your time on this.
saic_gcoAuthor Commented:
There are too many variables un-accounted for that could complicate and fault this solution (non-solution). We are going to dump flash and just do a basic HTML page as a gateway to the content.

Thanks for you help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.