views:

292

answers:

2

I have a lingo script which runs some data processing for a Flash movie. I can call my Lingo functions from Flash by putting the following inside one of my methods:

getURL("Lingo: myMethod");

and I can pass parameters from flash to lingo as follows:

getURL("Lingo: myMethod param");

However, if myMethod returns a value, I can't seem to send it back to ActionScript. How do I code the following:

var myVar = getURL("Lingo: myMethod");

where myMethod is defined as:

on myMethod
    --do something
    return 5
end myMethod

We are using Flash 9 with CS 3.

+2  A: 

You should be able to access Lingo via ExternalInterface assuming you're in Flash 8 or greater:

import flash.system.ExternalInterface;
var valueFromLingo = ExternalInterface.call("myMethod");
trace(valueFromLingo); // -> 5
wulong
I'll try that and let you know
Elie
We get back an undefined when we try this. Should I be using ExternalInterface.call("Lingo: myMethod")?
Elie
A: 

@wulong: the package is flash.external., not flash.system.