Elie
Elie

Reputation: 13855

Swapping information between ActionScript and Lingo

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.

Upvotes: 0

Views: 688

Answers (2)

vyger
vyger

Reputation:

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

Upvotes: 0

wulong
wulong

Reputation: 2697

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

Upvotes: 2

Related Questions