• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 602
  • Last Modified:

swf + fscommand(Flash 5 or mx)

Here is what I need to do.

I have a flash swf file that is being published as an executable.

This executable then in turn calls other swf files and plays them using an xml feed dynamically built.

i built a vb6 app which calls a webpage and displays it.

I need to know how to get the swf file(which is a child of the parent which is the swf exported as an executable) to launch the executable.

I know it involves an fscommand directory. Anyone can help ? I would love to be able to do it in flash mx. If the parent swf file is flash mx, will it still play the child if I export it in flash 5 ?
0
intertise
Asked:
intertise
  • 14
  • 9
1 Solution
 
BillystyxCommented:
fscommand(""exec","c:\etc\myexe.exe");

Billystyx
0
 
intertiseAuthor Commented:
will it work in flashmx ? i'll try it out.
0
 
BillystyxCommented:
remember to put the exe in a subfolder called fscommand - or it won't work in flash mx

Billystyx
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
intertiseAuthor Commented:
so lets say it is c:\intertise\fscommand, it would be

fscommand(""exec","c:\intertise\fscommand\myexe.exe");
0
 
BillystyxCommented:
no, just
fscommand(""exec","myexe.exe");
but make sure you add a folder named fscommand in same place.

Billystyx
0
 
intertiseAuthor Commented:
tried fscommand("exec","c:\intertise\fscommand\myexe.exe");

exports fine, can launch the swf file but nothing happens.

any way to debug ?
0
 
intertiseAuthor Commented:
Ok, so...

the root directory is c:\intertise. In there I have a folder called fscommand, in which resides weather.exe.

In the code I have in first frame is

fscommand("exec","weather.exe");

doesnt work. anyway to debug ?

the swf file resides in c:\intertise
0
 
BillystyxCommented:
As in my previous post, make your command:
fscommand(""exec","myexe.exe");

add a folder called fscommand to the same directory as your flash exe resides in .

(You need to publish the flash as an exe for it to work)

Billystyx
0
 
BillystyxCommented:
mkae sure you publish flash as exe:)

Billystyx
0
 
intertiseAuthor Commented:
damn, ok looks like I have to jerry rig this thing.

Ok a projector can call another projector as long as it is in fscommand directory.

is there a way to load the 2nd projector minimized ?
and is it possible to then have the actionscript close the projector after it executes the exec command ?

Your help is much appreciated.

Cristian.
0
 
BillystyxCommented:
why do you need a second swf loading the exe?
why don't you just put the command somewhere on the main swf? (In a button or something?)

Billystyx
0
 
BillystyxCommented:
BTW, to close a flash projecotor:
fscommand("quit",true);

Billystyx
0
 
BillystyxCommented:
aah, I see, you didn't want an application loaded, just another swf executable?
Is that it?

You could load the swfs all into one main swf, which is published as an exe... that might be cleaner.
Or am I now missing the point/overcomplicating the issue?

Billystyx
0
 
intertiseAuthor Commented:
yeah, here is why.

we have something called masterplayer. it is a projector that dynamically reads an xml file which tells it what to play.

We are an advertising company, and this is stored on machines that have no user intervention. I wanted to show a webpage.

So I cant screw with masterplayer unless I add new code that says if the xml file contains so and so type of file, launch the executable. I thught a simpler process is for the main executable, to call another executable, which is in turn a projector in fscommand which calls my other app. Perhaps it is a dirty solution, but I think it will work.

Thanks for the quit command, how about start minimized ?
0
 
intertiseAuthor Commented:
****, but I just realized, I still have to put in logic in my masterplayer to initiate fscommand.

humm, I'm sorry, guess you will earn your 500 points.

In actionscript, can I look at the file name ?

I mean, if instring(".exe") then fscommand("exec", "string");

?
0
 
intertiseAuthor Commented:
lol, and one last thing, after calling the fscommand is there a pause command based on x seconds ?

so once it launches the app it just hangs and doesnt do anything?

We are playing ads, so while it shows the webpage, it cant move on to the next line in the data.xml file.

0
 
BillystyxCommented:
none as far as I know with flash alone.
I think swish allows a few more fscommands, as do other swf related programmes.

Billystyx
0
 
intertiseAuthor Commented:
so actionscript doesnt have some way to search through a string and find out if it matches a certain phrase ?
0
 
BillystyxCommented:
OK, you can do
setInterval(functionname,intervaltime);
like
setInterval(myFunction,5000);//5000 is in milliseconds

so every 5000 milliseconds the function myFunction is called - in a function there put the things you want it to do/check.

0
 
BillystyxCommented:
flash doesn't (as I understand it), allow looking at files. You can do very limited file related stuff...
what you could do is fscommand("exec","abatchfile.bat");
and check stuff from the batch file... if you understand writing batch files, of course:)

Billystyx
0
 
BillystyxCommented:
You can search a string, but not in terms of directories file names...
for searching strings...
my_str.indexOf(substring, [startIndex])

is the syntax.

Billystyx
0
 
BillystyxCommented:
how did you go?

billystyx
0
 
BillystyxCommented:
Any luck?

Let me know how you went:)

billystyx
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 14
  • 9
Tackle projects and never again get stuck behind a technical roadblock.
Join Now