This page require Adobe Flash 9.0 (or higher) plug in.

ActionScript 3.0 : Common Errors – Number 5000

Over the weekend, I was rushing for some project of mine coding some AS3 package and I kept getting errors that goes like … “Error 5000 : The Class “xxx” must subclass “flash.display.MovieClip” since it is linked to a library symbol of that type” ; as much as I love AS3.0, it is frustrating sometimes to encounter error which didn’t help users to locate or fix the bug. I hope things will be better in the upcoming CS4.

 

Two possible situation as listed below.

 

1. Forget to import flash.display.* which is necessary for all display objects on stage.

Flash Actionscript IDE does not debug or trace for errors on real time coding so, most of the time the programmers will forget what’s happening.

 

2. Do not add function Brackets for Class

This is very common but surprisingly this is the most common mistake I do every time I script a package document class. Note: This error is hard to spot as the class is very near to the method functions. Just remember the syntax no function like brackets for class. e.g. like samples below :-

 

package{
//REMEMBER : Add import associated with the display.
import flash.display.*        
 
//REMEMBER : class does not have () like method functions.
      public class docClass extends MovieClip{
	      public function docClass(){
		     trace("Class Loaded Successfully");
	      }
      }
}

Other Cool Related Stuff

Leave a comment

Name: (Required)

eMail: (Required)

Website:

Comment:

CommentLuv Enabled