views:

240

answers:

1

I'm building a Flash CS4 custom panel extension, and while I can call jsfl from actionscript fine, I can't figure out how to get info from the jsfl queries back to my custom panel. MMExecute() seems like a one way street.

Specifically, I want to display a selection's X and Y position in the custom panel. How do I call fl.getDocumentDOM().getSelectionRect() in such a way that the results are accessible to the panel?

Any help is much appreciated, Matt

+1  A: 

Ok, I think I've figured it out. MMExecute() does in fact return a string, it's just often empty. It returns whatever string the first called jsfl function returns, if the jsfl function returns a string.

Thus if the called jsfl api function doesn't return a string, you just need to write your own jsfl wrapper function for it that converts whatever it does return into a string that's useful to your actionscript.

Matt W
Hi, Glad you got it sorted it out. If it helps you can give JSFLInterface a try: http://exanimo.com/actionscript/jsflinterface/ .I try to write extensions from time to time, but I find it easier to write most of it in JSFL then do the WIndowSWF with MMExecute("fl.runScript(fl.configURI + 'Javascript/MyScript.jsfl', 'myScriptMethod');");
George Profenza