You were pretty close to having it work right. I couldn't get it to work until I figured out how to get MMExecute to return variables. What you need to do is declare a variable in your jsfl, set its value and then at the very end of that jsfl script just type the name of the variable. That will return the value of your jsfl variable through MMExecute and then you can use the data in your .swf. Here's some example code:
ActionScript Code:
var xLoc = "var loc = fl.tools.penLoc.x;\n";
xLoc +="loc;"; //Returns loc (fl.tools.penLoc.x)
var yLoc = "var loc = fl.tools.penLoc.y;\n";
yLoc +="loc;"; //Returns loc (fl.tools.penLoc.y)
var mySelection = "var loc = fl.tools.penLoc;\n";
mySelection +="var selection = fl.getDocumentDOM().selection;\n";
mySelection +="var selectionToDisplayInSWF = selection[0];\n";
mySelection +="selectionToDisplayInSWF;";//***Returns the first element in the selection array***
addEventListener("enterFrame", checkFrame);
function checkFrame(evt){
position.text = "x: " + MMExecute(xLoc) + ", y: " + MMExecute(yLoc);
mytxt.text = MMExecute(mySelection);
}
*In order for this to work you'll need two textfields... position and mytxt.