This works here:

import mx.utils.Delegate;
var callJSFL_btn:mx.controls.Button;

function callJSFLClickHandler(o:Object):Void {
 trace("Application ::: callJSFLClickHandler");
 var uri = MMExecute('fl.configURI')+"jsfl/myCommand.jsfl";
 var func = "sayHello";
 MMExecute('fl.trace("'+uri+'")');
 MMExecute('fl.runScript("'+uri+'", "'+func+'")');
}
callJSFL_btn.addEventListener("click", Delegate.create(this, 
this.callJSFLClickHandler));

Note that I'm using single and double quotes, so I avoid having to escape 
quotes (and get lost in the process).

Yeah, the path notation is a bit odd: file:///C|/
but that's the way jsfl expects it to be.

regards,
Muzak

----- Original Message ----- 
From: "Steven Sacks | BLITZ" <[EMAIL PROTECTED]>
To: <flashcoders@chattyfig.figleaf.com>
Sent: Tuesday, April 10, 2007 3:20 AM
Subject: RE: [Flashcoders] Create MXI/MXP with External JSFL


Muzak,

Thanks for your response.  Unfortunately, it's not working for me when I
try to test it before I even make it an MXI/MXP.

I created a jsfl folder inside the Configuration folder and put my jsfl
file in there.

uri = MMExecute("fl.configURI") + "jsfl/test.jsfl";
MMExecute("fl.trace(\"" + uri + "\")");

It traces it out just fine when Flash launches, but when I try to
runScript one of the functions in that jsfl file it says argument 1 is
invalid.

var func = "testFunc";
var cPath = MMExecute("fl.runScript(\"" + uri + "\", \"" + func +
"\")");

This works just fine if I hardcode the path to the JSFL on the C: drive.
There is one weird thing where it changes the : to a | with configURI
but the documentation says that it's supposed to work just like it is.

Any ideas?

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