|
From: David H. <em...@da...> - 2006-12-27 18:21:38
|
Marcelo,
I think you have two options. First, I think you are OK in creating an
instance of your class on the test swf, but I have had better luck in
creating an empty movieclip and then attaching my new class to that. Then,
you create an instance of the class you are testing via an attachMovie() on
the test clip, and cast it as a type of the class you are testing.
private var testClip:MovieClip;
private var instance:myClass
function setUp():Void {
testClip = _root.createEmptyMovieClip( "testClip", 100 );
instance = myClass( testClip.attachMovie("someClass", "someClass_mc", 0)
);
}
You can also use createClassObject() if your class extends UIObject.
Be sure you properly remove all the clips in tearDown() that you created in
setUp() or they will clutter up your test SWF.
Hope this helps,
OK
DAH
|