Im in as3 and Im trying to add a MovieClip inside of a Class I don't get any errors but my image does not show up.
This is my Class Code, my MovieClip is called woopa1
package
{
import flash.display.MovieClip;
import woopa1;
public class koopa extends woopa1
{
public function koopa()
{
trace(woopa1);
var woopa:woopa1 = new woopa1();
addChild(woopa);
woopa.x=100;
woopa.y=100;
woopa.height = 60;
woopa.width = 38;
}
}
}
It traces [Class woopa1] this is my Code in the frame calling the class
function onenterEnemy(event:Event):void
{
var enemy:koopa = new koopa();
}
Why doesn't my image show up?
Have you added your
enemyinstance to the display list?Also since you create an instance of your
woopa1class and add it tokoopa, yourkoopaclass should probably extendMovieCliporSpriteinstead of yourwoopa1class.On a separate note, you may also want to name your classes with names that start with an uppercase character. So
koopashould beKoopaandwoopa1should beWoopa1.