Dier02
asked on
flash 8
I have a flash swf and in it I have a dynamic text box. I have a number of buttons underneath the text box. Each button when clicked should run a batch file which creates a text file - the dynamic text box reads that text file and renders the text in the swf. How do I get the buttons to open the batch files?
ASKER
I want to link this command to a button so that when I click the button the fscommand and batch file is executed. This is just an idea I had and wanted to test but the concept is this - I want to drag a button onto a particular area. Then some sort of hit test occurs which identifies the button - executes the fscommand for that button which outputs a text file which is then read into the dynamic text box. Is that possible?
For example - say I have three employees named fred, tom and jack. When I drag jacks nametag to a specific place on placing it there it causes an fs command that has a bat file write a specific text (NAme, address, phone number etc) and this is displayed in the dynamic text file window.
For example - say I have three employees named fred, tom and jack. When I drag jacks nametag to a specific place on placing it there it causes an fs command that has a bat file write a specific text (NAme, address, phone number etc) and this is displayed in the dynamic text file window.
select Button instance on stage and add following script in ActionScript panel
//-------------
on(release)
{
fscommand ("exec", "batchFile.bat");
-----------------
//-------------
on(release)
{
fscommand ("exec", "batchFile.bat");
-----------------
Oops, by mistake submit button gets pressed, and incomplete comment get publish,,
please ignore previous comment, here is the complete response
select Button instance on stage and press F9 to open Actioscript panel,
now add following script in ActionScript panel:
//-------------
on(release)
{
fscommand ("exec", "batchFile.bat");
}
-----------------
But this code will run .bat file only if swf gets converted into Flash Projector and .bat file is residing in folder "fscommand" and folder "fscommand" must besides Flash projector
- Aneesh Chopra
please ignore previous comment, here is the complete response
select Button instance on stage and press F9 to open Actioscript panel,
now add following script in ActionScript panel:
//-------------
on(release)
{
fscommand ("exec", "batchFile.bat");
}
-----------------
But this code will run .bat file only if swf gets converted into Flash Projector and .bat file is residing in folder "fscommand" and folder "fscommand" must besides Flash projector
- Aneesh Chopra
ASKER
The only problem with this is that the text file that the bat outputs goes into thefscommand folder instead of the directory above it where the projector resides
ASKER
what batch command could you use to write the text file to the directory with the projector in it?
that a seperate query, which is not related to Flash part,
you can use "copycon" command
you can use "copycon" command
ASKER
copycon what - for example my batch file is called var1 and the text file it outputs is called var1.txt - thanks for your patience
ASKER
happy to resubmit question to you in another area if you like
Ok,
here is the var1.bat file which will write var1.txt file
var1.bat content:
----------------------
echo this is the content of text file >>var1.txt
exit
--------------------
- Aneesh Chopra
here is the var1.bat file which will write var1.txt file
var1.bat content:
----------------------
echo this is the content of text file >>var1.txt
exit
--------------------
- Aneesh Chopra
ASKER
Thanks but I have done that- the problem is that it writes the text file to the "fscommand" folder instead of the folder above it (called "pro") with the projector in it. When I manually move the text file then the projector can "see" it. I wanted the batch file to write the text file to the same directory as the projector is in
ASKER
It currently outputs it to the fscommand directory rather than to the pro directory
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
flash swf can't run .bat file,
2.
Although If you create Flash Projector, it can run .bat file, but still there are few conditions to run batch file from a flash projector
3.
you must have a folder "fscommand" parallel to your Flash Projector, and must have .bat files in this folder, then only flash projector can run it.
4.
I assume you created the folder "fscommand" and placed ur .bat files in it.. now following code in flash will execute .bat file:
//-----------------
fscommand ("exec", "batchFile.bat");
//---------------
IMPORTANT, you dont need to specify "fscommand" folder name with .bat file name, Flash projector will itself look for .bat file in "fscommand" folder and run it.
- Aneesh Chopra