View Full Version : Opening HTML page from jsfl
jesmith
12-15-2004, 06:14 PM
I'm developing a tool that generates a .JSFL file, which in turn creates a ready-to-run Flash presentation. (It starts with a template .FLA file, and then adds a bunch of stuff to it.) At the end of my script, I do:
doc.publish();
to create the .SWF file, and then I'd like to open a HTML file to display the results. The HTML file is not generated by Flash -- it contains a bunch of other stuff generated by my tool.
Does anyone here know of a way to either:
1) Open an HTML file from a .JSFL script, or
2) Execute an arbitrary O/S command from a .JSFL script?
Any ideas, no matter how whacky are appreciated...
-Joshua
petefs
12-15-2004, 08:49 PM
This is one of those 'no matter how wacky' things: It has to be possible with the c-level extensibility ^_^
There's probably an easier way, though : )
hangalot
12-16-2004, 01:47 PM
this should sort u out:
http://www.asvguy.com/2004/07/undocumented_fl.html
jesmith
12-16-2004, 03:52 PM
That article says it requires MX 2004, which I understand from the scuttlebut is not something everyone is willing to use, because of stability issues.
But thanks for the pointer!
Is there a similar solution which will work in ordinary Flash MX?
-Joshua
hangalot
12-16-2004, 03:55 PM
well AFAIK jsfl only works on FMX2004. ur bigger concern is that it needs 7.2
jesmith
12-16-2004, 04:30 PM
well AFAIK jsfl only works on FMX2004. ur bigger concern is that it needs 7.2
Yikes!
I guess that since when I right-clicked a .JSFL file, and the Open With... menu showed 6.0r25 as an option, I assumed this was an MX feature. But I've just confirmed what you said: MX doesn't understand .JSFL.
(As you might have guessed, I'm not a Flash user. I'm a software developer trying to develop something for Flash users to use. I'm really surprised that Flash got all the way to version 2004 without having a scripting language...)
So your solution does seem like a good option. However, I've come up with another one which I actually kind of like:
I inserted an empty frame at the beginning of the movie. Into this frame, I put the ActionScript command:
// If we are running stand-alone, open a browser
if (System.capabilities.playerType=='External') {
getURL(_url.substring(0,_url.length-9)+'template.html'); stop();
}
Then in my JSFL script, I end with doc.testMovie() which opens the standalone player, which opens the HTML.
What do you think of this approach?
-Joshua
hangalot
12-16-2004, 04:37 PM
i might not b understanding it completely, but it does seem to be a long way around. have u considered just writing a python/perl script or a batch command?
jesmith
12-16-2004, 04:52 PM
I need to use JSFL to populate the template.
If I wrap the invocation of the JSFL in a batch, there is no way for that batch command to know when the JSFL is finished, so there is no way for it to know when to open the HTML file.
Therefore the JSFL needs to open the HTML file.
I now have two ways of doing that:
1) Use the undocumented FSFile class, or
2) Embed a single-frame script that asks the TestMovie window to launch the browser
I kind of like option #2 better, because it means that the Flash developer can just hit Ctrl-Enter, and have it compile the movie and open my HTML file to test it out.
-Joshua
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.