Reputation: 44
When I trying to import ExternalInterface:
import flash.external.*;
class Main
{
public static function main(swfRoot:MovieClip):Void
{
System.security.allowDomain("*");
ExternalInterface.addCallback("abc", _global.ChatMessage);
}
public function Main()
{
}
}
I get this error:
Unknown variable ExternalInterface
However, I imported it. What is the problem?
Upvotes: 0
Views: 48
Reputation: 10520
There are a few things to try when getting an error like that.
First check your spelling. Often it can be a simple typo causing all your issues.
Next, try importing the Class explicitly, rather than using a package wildcard. so...
import flash.external.ExternalInterface;
You should also wrap any usage of the externalInterface class in check if ExternalInterface.available
.
Upvotes: 0