I am attempting to add a child to the stage with the following code:
Actionscript Code:
//Buttons: Adds movie clip to stage.
readtomeShortA1.addEventListener(MouseEvent.CLICK, playShortAReadMe1);
function playShortAReadMe1(e:TimerEvent):void{
var playShortA1:ShortAReadMe1 = new ShortAReadMe1
addChild(playShortA1);
playShortA1.x = 307;
playShortA1.y = 603;
}
When I test the movie the following message appears, "TypeError: Error #1034: Type Coercion failed: cannot convert flash.events::MouseEvent@212a161 to flash.events.TimerEvent," when I click the button ("readtomeShortA1"). Note the instance I am referring to is a button. When the swf is created there are compile errors that appear. The "TypeError....." only happens when I click on the button ("readtomeShortA1").
FYI, there is other code on the page which is below the code in question:
Actionscript Code:
//Button Code
backTo.addEventListener(MouseEvent.CLICK, backToShortA);
function backToShortA(event:MouseEvent):void
{
gotoAndPlay(1);
SoundMixer.stopAll();
}
ForwardTo2.addEventListener(MouseEvent.CLICK, toPage2);
function toPage2(event:MouseEvent):void
{
gotoAndPlay("page_2");
SoundMixer.stopAll();
}
What am I doing wrong?