GulgDev
GulgDev

Reputation: 44

FlashDevelop not importing flash packages

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

Answers (1)

Adam Harte
Adam Harte

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

Related Questions