Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Program Flash MX 1

Status
Not open for further replies.

fluteplr

Programmer
Oct 23, 2000
1,599
US
OK I am a totaly newby to Flash so I have probably done something stupid.

I am trying to create a menu to launch programs using flash mx. I have created movie with 4 buttons, and I can get the buttons to do various thing in the up, over, hit etc. frames. But when I try to add an action like fscommand the action editor box has 'this selection cannot have actions applied to it. What am I doing wrong?

Step by step instructions would be gratly appreciated.



 
chances are your puting the code without telling flash when to do it. try this:

on (press) {
//code here
}

put this code on you button (right click on the button, and go to actions), then you can put your fscommand in there, and you shoulden't get that error.
 
OK, I tried that. Put the following code in actions

on (press)
{fscommand("exec","D:\proj6\trac7\loadtrac.exe");}

Tested it, no debug errors. But nothing happens Exported to HTML nothing happens.

Any ideas.

 
Yeah, the reason it isn't working is because macromedia put a "safety feature" into their new player which doesn't allow a movie to call and executable unless it is in the directory "fscommand", and it must be one level lower in the directory tree than the flash movie is. The way I get around this is by creating a batch (.bat) file that calls the exe I need, then put that batch file into the fscommand directory. then right click on the batch file and create a shortcut to it. Right click the shortcut goto properties and select run minimized.

Now, go back to flash:
on (press)
{fscommand("exec","whatever_you_name_the_shortcut.pif");}

If this doesn't work for you, post again and I'll make an example for you. __________________________________
Keep On Coding!!

Lumstar
 
Well that was certainly non obvious. I will try it and let you know.

 
OK still no go.

This code is in my button

on (press) {fscommand("exec","test3.bat");

}

the .swf file is in d:\temp
the .bat file is in d:\temp\fscommand

I would appreciate the example.
 
Thanks for the sample, it works great. Now I just have to figure out why mine does not.
 
what is it exactly that isnt workoing on yours??

send me the .fla and i will fix it up and return it to you.

I can have it done by Friday at 3pm if you sent it to me tonight.


stephenlombardi@yahoo.com __________________________________
Keep On Coding!!

Lumstar
 
I got it finally. Thanks for the offer though. Now if it would just launch Windows scripting host files .vbs or .js, I could solve about 10 other problems. I guess I will have to wait till the Jester folks get their MX update out.
 
You know what else is annoying! It will run .bat and .pif but 2000 and XP use .lnk files in place of the .pif files. It won't run those.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top