Since a JSFL topic came up I thought I'd dig up my JSFL Executer command.
It's a command that pops a Dialog (XUL) with a simple mulitline textbox.
You can fill in some jsfl code, hit "ok" and the jsfl will be executed.
Comes in handy for quickly testing pieces of code.

There's two files, one jsfl and one xml.

"JSFL Executer.jsfl"

var jsflDialog = fl.getDocumentDOM().xmlPanel(fl.configURI + 
"Commands/xul/JSFL_Executer.xml");

if (jsflDialog.dismiss == "accept") {
 fl.trace(eval(jsflDialog.script_txt));
}


"JSFL_Executer.xml"

<?xml version="1.0" encoding="utf-8"?>
 <dialog id="JSFLDialog" title="JSFL Executer" buttons="accept, cancel">
  <label control="script_txt" value="Fill in the JSFL code to run." />
  <textbox id="script_txt" size="60" multiline="true" />
 </dialog>


Save both files and put them in:

Commands/JSFL Executer.jsfl
Commands/xul/JSFL_Executer.xml

You can then run the command from the Commands menu in the Flash IDE.
Fill in some jsfl and run it (note the it will actually *run* the code).
For instance if you fill in:
fl.getDocumentDOM().frameRate;

It will display the documents current framerate in teh output panel

However if you run:
fl.getDocumentDOM().frameRate = 21;

It will actually change the current document's framerate to 21 ;-) and display 
it in the output panel.

Taking Steven's jsfl code from the previous thread, this will execute as well:

var uri = fl.configURI+"jsfl/myCommand.jsfl";
var func = "sayHello";
fl.trace(uri);
fl.runScript(uri, func);

Hope someone finds it useful.

regards,
Muzak


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to