If you specify a class for the Document class, you have to implement it
somewhere in your classpath:
e.g.
/* ColorTest.as is your class */
package {
import flash.display.Sprite;
import flash.events.Event;
import MyBlock;
public class ColorTest extends Sprite { //or extends MovieClip
//You don't need to declare this variable if you select
Automatically declare stage instances.
//private var myBlock:MyBlock
public function ColorTest() {
addEventListener(Event.ADDED_TO_STAGE, _addedToStage);
}
private function _addedToStage(e:Event):void {
trace("myBlock is " + myBlock);
}
}
}
Make sure you match case with your instance of MyBlock on stage - it
should by myBlock
There maybe the odd import error here because this is off-the-top-of-my-head
HTH
Glen
Charles Parcell wrote:
Having read numerous past posts on this list, I am still not clear on how to
fix the issue I have.
Basically, I have a document class and a class attached to a MC on stage
that extends MovieClip. I have set "Automatically declare stage instances"
OFF. I have imported MyBlock (the class attached to the instance on stage)
into the document class and declared the instance name as type MyBlock.
import MyBlock
...
var private myBlock:MyBlock;
I get no compile errors by I get two 1065 errors. The first is for the
document class (ColorTest) and the second is for the MyBlock class.
"
ReferenceError: Error #1065: Variable MyBlock is not defined.
ReferenceError: Error #1065: Variable ColorTest is not defined.
"
What is the magic piece that I am missing to fix this? I fail to understand
how or where Flash expects me to define the document class.
Charles P.
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
--
Glen Pike
01326 218440
www.glenpike.co.uk <http://www.glenpike.co.uk>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders