I am brand new to Actionscript and this is one of my first "scripts" by myself so forgive me if this is obvious.
I have a movieclip with the name "Smiley"
and this is my actionscript in frame 1 of the actions layer
stage.addEventListener(MouseEvent.MOUSE_MOVE, mousePosition);
var smiley:MovieClip = addChild(new Smiley) as MovieClip; // **ERROR HERE**
stage.addEventListener(MouseEvent.MOUSE_DOWN,toggleSmiley);
stage.addEventListener(MouseEvent.MOUSE_UP,toggleSmiley);
function mousePosition(event:MouseEvent) {
smiley.x = mouseX; smiley.y = mouseY;
}
function toggleSmiley(e:MouseEvent):void
{
smiley.visible = (e.type == MouseEvent.MOUSE_DOWN);
}
See the line marked "ERROR HERE" above, thats where Flash is throwing the error.
I am getting this error:
Scene 1, Layer 'actions', Frame 1, Line 6 1180: Call to a possibly undefined method Smiley.
Am confused as to where the problem is. Thanks in advance.