GideonKain
GideonKain

Reputation: 744

ExternalInterface - There is no method with the name

I know very little about Flash, but I need to be able to call a JS function from inside a ActionScript file.

When I enter the line:

ExternalInterface.call("alert", "test");

I get the error:

There is no method with the name 'ExternalInterface'.

In the tutorials it seems I have to include the namespace:

import flash.external.ExternalInterface;

but I don't know where to put that?

I place it outside the class that extends a mediaclip and it does nothing.

How do I include that reference so that the ExternalInterface method is recognized?

What's odd is that intellisense works and allows me to type it in and gives me the overloaded methods, so it knows what I'm trying to say, it just doesn't work when I try to compile it.

Upvotes: 0

Views: 269

Answers (1)

Vulturous
Vulturous

Reputation: 141

You could also try access the class doing this:

flash.external.ExternalInterface.call("alert", "test");

That way you don't have to import the package with the class.

Upvotes: 1

Related Questions