PDA

View Full Version : class problem import through Linkage Properties



_dfm_
July 5th, 2007, 03:15 PM
hello,

I want to Linkage one MC in my library. So I wrote
In Class zPlayerClasses.contoller,
In Base class flash.display.MovieClip

My class contoller is located in folder zPlayerClasses, and it is in the main directory (with .swf).

this is my class script:
package zPlayerClasses{
public class contoller extends flash.display.MovieClip {
public function contoller():void {
trace("contoller class instance");
}
}
}

After compile output this error, why?

1017: The definition of base class MovieClip was not found.
5000: The class 'zPlayerClasses.contoller' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.

The some error come after change flash.display.MovieClip to MovieClip

NaughtyPine
July 5th, 2007, 03:45 PM
I'm a little confused with your question and methodology.

You haven't imported any classes into your code or anything yet.

You need to add this to your package script:
import flash.display.*;

_dfm_
July 5th, 2007, 04:08 PM
ok I add import flash.display.*;

but this error come
1046: Type was not found or was not a compile-time constant: TextField.

senocular
July 5th, 2007, 04:39 PM
add:
import flash.text.TextField;

You have to use import for all the classes you're using not defined in the same package path.

_dfm_
July 5th, 2007, 05:57 PM
10x solved.

To ask sth, so my instance is MC in it it has buttons, text fields and other MCs. so I have to import these classes to run successfully?

Dazzer
July 5th, 2007, 09:46 PM
pretty much. It doesn't know what those things are until you have imported their definitions.