Flash Projector And Documents

jesserobbins
jesserobbins used Ask the Experts™
on
Hi,

I have created a flash projector file that launches fullscreen using fscommand. My problem is is that I have several links
to documents (.pdf) within the flash movie. In windows XP, when the user clicks one of these links, the projector stays fullscreen and the document opens up behind the projector, so it looks like nothing happens.

Does anyone know how to make it so the document will come up front yet keeping the projector window fullscreen?

Thanks,

Jesse
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
you should use a .bat to launch all of your exteranl links and applications, so they appear above the .exe


here is what you would put on you buttons:

on(release){

  fscommand("exec", "foldername/launch1.bat");

}


to create the launch1.bat you would open up Notepad and put the following in:

@echo off
START foldername/pdfName.pdf
exit


then you would save the file as "launch1.bat"


this works great, because it will open your file in the default application....


if you only have access to Flash MX, then you would need to place your .bat files in a folder called "fscommand" and reference them from there...  this is a security issue...

rp
by the way, there is not other way to have the files open in front of the Projector file....

for some reason it takes priority over everything....

rp

Author

Commented:
What about if the actual buttons are hyperlinks loaded from a text file? :)
Should you be charging more for 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 using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

you would have to use "asfunction"

and then call a function inside of the SWF...  I think you could use an include file for the function as well...

here is what the text would look like:

test=Blah this and blah that  <A HREF='asfunction:pdfFunction1'>click here</A>&


here is what you would put in your external Actionscript file:


function pdfFunction1(){
   fscommand("exec", "foldername/launch1.bat");
}


you would then load your external actionscript file in the first frame of your movie like this:

#include "functions.as";


above functions.as is the name of the file and it is in the same folder as the SWF.


this solution still allows you to have your content be seperate from your SWF and all you have to do to change the code, is update the text file or the actionscript file(text file with an .as extension)


I am about to go on Holiday for the next 3 days, so if you need more help, I can do it when I get back...


but if you need help, I would recommend searching this web site for the solutions, becuase I am sure this has been asked before...


rp


ERROR IN CODE...

take out the ";" in the code above...  I am so used to putting one after other stuff...


here is why in case you wanted to know:


http://www.macromedia.com/support/flash/ts/documents/includesemicolon.htm

rp

Author

Commented:
This is not working for me. I did the following, what am I missing?

1) placed #include "functions.as" in first frame of movie
2) created functions.as file in same dir as movie
3) included the function from above in the functions.as file
4) included <a href="asfunction:pdfFunction1"> in dynamically loaded text file

I even placed the asfunction in the link for a static text field.....still didn't work. Seems the include isn't working...any ideas?

Thanks

Author

Commented:
By the way.....I created the bat file as well. Ran it and it worked fine.

Author

Commented:
Also, just for you to know that to test out, I simply placed an fscommand as so on the first frame instead of the include:

fscommand ("exec", "bats/launch1.bat");

This did nothing as well.

are you using Flash 5 or MX to develop this?

if you are using flash MX, then you can't put your .bat or .exe files in any folder other than one with the name of "fscommand"  this is a security issue....

if you are using Flash 5, then make sure your path is set up correctly, or that your .bat file's path is set up correctly...

those are typically the areas that I always miss  :)

I think I will build a sample of this type of application...  it seems like I can use it in other projects...


rp

Author

Commented:
I am using flash mx. Here is the actionscript I have on my first frame:

fscommand("exec", "bats/launch1.bat");

I have the launch1.bat in the "bats" folder and the batch file has the following line in it:

START ../Documents/us-application2003.pdf

When I open my start.exe file, nothing happens. All of the other fscommands work (allowscale, fullscreen, etc.), but not the exec.

????

Author

Commented:
Rascalpants....I am completely perplexed here.

To make things as simple as possible I did the following:

I made a test movie with the following actionscript on the first frame:

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

I place this movie in the same directory as the batch file. I ran the movie and still nothing happens.
Is Flash MX not able to run batch files or something?

Thanks.
Jesse,

It seems that you don't completely read my posts  :)  I have mentioned 2 times now that if you are using Flash MX, that you need to put your .bat files in a folder with the name of "fscommands"  this is the only way that Flash MX will allow any type of launching of .exe or .bat files...  


I will post my sample file in a few minutes that is for Flash MX...  


rp

Author

Commented:
Ok, sorry for mis-reading your posts.

Thanks :)

Author

Commented:
Got it to work. I had tried this before and it didn't work, but just realized that you don't have to put the exact path to the fscommand folder. This is not well documented, but thanks for your help. Place a post on the other question and I'll award you the extra 50 points.

Thanks again! :)
as promised:

try this site first(it might be having problems though)

http://www.kcnewmedia.com  /dynamic_control.zip

then this one...

http://www.rascalpants.com  /dev/dynamic_control.zip  


just take out the spaces above in the urls...  I will also be taking this file down later today so I can conserve space...


take a look at how I handled everything...  the work will explain more than I can...  let me know if you have any questions..

also, please don't forget to close out this one as well  :)

good luck and let me know if you need more help...


rp

Author

Commented:
Ok rascalpants....the plot thickens!! :)

Say I have a projector file called start.exe .

I also have several other .swf files that are loaded into the start.exe projector. My problem now is is that the .swf file doesn't launch the batch file. Any suggestions?

Thanks,

Jesse
FYI...

I am having problems with both of my sites now!!!  but they tell me that they will be up shortly...

anyway...  just thought I would let you know...


rp

Author

Commented:
I received the files fine....did u see my post from above?
check you paths again  :)

As long as you are calling the launch1.bat in the right way, then there should not be a problem...


rp

Author

Commented:
It works fine when I publish as a projector (.exe), but not as an .swf

?
not sure why...  I would double check that you are loading in the .SWF correctly...


rp

Commented:
Hello there,

>It works fine when I publish as a projector (.exe), but not as an .swf

It is because the swf file can't handle exec commands, as those are meant for projectors. (From what I know)

greets,

Cërf.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial