Link to home
Start Free TrialLog in
Avatar of intertise
intertise

asked on

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 ?
Avatar of Billystyx
Billystyx

fscommand(""exec","c:\etc\myexe.exe");

Billystyx
Avatar of intertise

ASKER

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

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

fscommand(""exec","c:\intertise\fscommand\myexe.exe");
ASKER CERTIFIED SOLUTION
Avatar of Billystyx
Billystyx

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
tried fscommand("exec","c:\intertise\fscommand\myexe.exe");

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

any way to debug ?
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
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
mkae sure you publish flash as exe:)

Billystyx
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.
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
BTW, to close a flash projecotor:
fscommand("quit",true);

Billystyx
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
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 ?
****, 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");

?
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.

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

Billystyx
so actionscript doesnt have some way to search through a string and find out if it matches a certain phrase ?
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.

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
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
how did you go?

billystyx
Any luck?

Let me know how you went:)

billystyx