Koden
Koden

Reputation: 353

An ActionScript file must have at least one externally visible definition

My main timeline code reads

var BlueBox:MovieClip = new bluebox(); 

include "bluebox.as";

My AS file reads

addChild(BlueBox);

I am getting weird errors, the documentation I read on flash's website said you can include ActionScript in an AS file as if it were on the timeline with the include function or with <mx:Script source="Box.as" /> however I am getting an error about classes or something irrelevant nonsense. I am not trying to include a class, just trying to include the AS file.

Line 1 5007: An ActionScript file must have at least one externally visible definition.

Upvotes: 0

Views: 1158

Answers (1)

Koden
Koden

Reputation: 353

figured it out finally just add a function definition in AS file

choosefunctionname(); // to execute function of code

function choosefunctionname(): void
{
   //code here
}

Upvotes: 1

Related Questions