Question
problem with external as file
Hi everyone
Im currently experimenting with AS3 and I’m trying to attach an external actionscript file to a movie clip in the library
but I keep getting error messages, my .as file worked fine in AS2 and I cant figure out what the problem could be
heres the code in my fla file
var mymc:MovieClip = new Block;
this.addChild(mymc);
trace(mymc._framecount);
and heres my as file code
class Block extends MovieClip
{
public var _blocktype:Number;
public var _framecount:Number;
public function Block()
{_blocktype = 0;
_framecount = 6; }}
And I get the following errors when I run the main fla file
1017 the definition of base class movieclip was not found
5000 the class 'block' must subclass flash.display.MovieClip
I find this strange because AS2 never had this problem with my .as file anyway I did a bit of Goggling and changed the code to
package{
import flash.display.MovieClip;
class Block extends MovieClip
{
public var _blocktype:Number;
public var _framecount:Number;
public function Block()
{_blocktype = 0;
_framecount = 6; }}}
and now I get this error
1080 call to a possibly undefined method Block. var mymc:MovieClip = new Block;
I’ve checked the export for actionscript tick box and the class name is the same Block (capital B), its driving me nuts can anybody please put me out of my misery
Im currently experimenting with AS3 and I’m trying to attach an external actionscript file to a movie clip in the library
but I keep getting error messages, my .as file worked fine in AS2 and I cant figure out what the problem could be
heres the code in my fla file
var mymc:MovieClip = new Block;
this.addChild(mymc);
trace(mymc._framecount);
and heres my as file code
class Block extends MovieClip
{
public var _blocktype:Number;
public var _framecount:Number;
public function Block()
{_blocktype = 0;
_framecount = 6; }}
And I get the following errors when I run the main fla file
1017 the definition of base class movieclip was not found
5000 the class 'block' must subclass flash.display.MovieClip
I find this strange because AS2 never had this problem with my .as file anyway I did a bit of Goggling and changed the code to
package{
import flash.display.MovieClip;
class Block extends MovieClip
{
public var _blocktype:Number;
public var _framecount:Number;
public function Block()
{_blocktype = 0;
_framecount = 6; }}}
and now I get this error
1080 call to a possibly undefined method Block. var mymc:MovieClip = new Block;
I’ve checked the export for actionscript tick box and the class name is the same Block (capital B), its driving me nuts can anybody please put me out of my misery