You can use fl.runScript() to execute jsfl files. I usually install them 
alongside the Panels in a sub directory called jsfl, unless 
the jsfl file has to be accessable via the Command menu in the Flash IDE in 
which case they need to be stored in the Commands folder 
in the Flash Configuration directory (and you can't put them in sub folders).

Flash Panels end up in the WindowSWF folder inside the Flash configuration 
directory.
So jsfl files that are inteded to be used (called) by a Flash Panel go into 
"WindowSWF/jsfl/".

You can get the path to the Flash configuration directory using:
fl.configURI

Here's an example:

import mx.utils.Delegate
var callJSFL_btn:mx.controls.Button;
function callJSFLClickHandler(o:Object):Void {
 trace("Application ::: callJSFLClickHandler")
 MMExecute('fl.trace(fl.configURI)');
 MMExecute('fl.runScript(fl.configURI+"WindowSWF/jsfl/myCommand.jsfl")');
}
callJSFL_btn.addEventListener("click", Delegate.create(this, 
this.callJSFLClickHandler));


In your mxi file, use the following to put jsfl files in the "Commands" folder 
or in the "WindowSWF/jsfl" folder.
Folders that do not exist are created for you.

 <files>
  <!-- jsfl file stored in commands folder -->
  <file name="MyCommand.jsfl" destination="$flash/Commands" />
  <!-- jsfl file stored in WindowSWF folder for use with Flash Panel -->
  <file name="MyPanelCommand.jsfl" destination="$flash/WindowSWF/jsfl" />
 </files>

regards,
Muzak

----- Original Message ----- 
From: "Steven Sacks | BLITZ" <[EMAIL PROTECTED]>
To: <flashcoders@chattyfig.figleaf.com>
Sent: Monday, April 09, 2007 11:41 PM
Subject: [Flashcoders] Create MXI/MXP with External JSFL


Hey FC,

I have a Flash panel I created which requires an external JSFL file to
run.

How do I package up the JSFL file into the MXI/MXP and how do I
determine what the file path is to it load said JSFL from inside the
Actionscript of the panel SWF?

Wrapping the JSFL into Actionscript is not an option.  It's far too
complex.

Thanks,
Steven


_______________________________________________
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