Below is all the code that I have played around with and get the error
"TypeError: Error #1007: Instantiation attempted on a non-constructor."
Code:import fl.transitions.Tween; import fl.transitions.easing.*; import fl.transitions.TweenEvent; import flash.events.TimerEvent; import flash.utils.Timer; import flash.utils.setTimeout; var mc0:mcClip0 = new mcClip0(); // each mc is associated with its' own class, whose base class is MovieClip(); var mc1:mcClip1 = new mcClip1(); var mcList:Array = new Array [mc0, mc1]; var imgCount:uint = 2; var currentImage:uint = 0; var myTimer:Timer = new Timer(1500, 1); //var mc:MovieClip; var xPos:Number = stage.stageWidth/2; var yPos:Number = stage.stageHeight/2; //var mc:MovieClip=new mcList[currentImage](); //addChild(mc); //mc.x= Math.floor(Math.random() * (stage.stageWidth-(mc.width*1.5))) + (mc.width/2);//xPos; //mc.y= Math.floor(Math.random() * (stage.stageHeight-(mc.height*1.5))) + (mc.width/2);//yPos; mcLogoStart(); addChild(mcList[currentImage]); myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timerHandler); function mcLogoStart():void{ mcList[currentImage].x= Math.floor(Math.random() * (stage.stageWidth-(mcList[currentImage].width*1.5))) + (mcList[currentImage].width/2);//xPos; mcList[currentImage].y= Math.floor(Math.random() * (stage.stageHeight-(mcList[currentImage].height*1.5))) + (mcList[currentImage].width/2);//yPos; var mcLogoTween:Tween = new Tween(mcList[currentImage], "alpha", None.easeIn, 0, 1, 2, true); mcLogoTween.addEventListener(TweenEvent.MOTION_FINISH, freezeImage); } function freezeImage(e:TweenEvent):void{ // if(mcList[currentImage].alpha==1){ myTimer.start(); } if(mcList[currentImage].alpha==0){ currentImage++; if(currentImage==imgCount){ currentImage=0; } addChild(mcList[currentImage]); //mc:MovieClip=new mcList[currentImage]; //addChild(mc); mcLogoStart(); } } function timerHandler(e:TimerEvent):void{ mcLogoFinish(); } function mcLogoFinish():void{ var mcLogoTweenOut:Tween = new Tween(mcList[currentImage], "alpha", None.easeOut, 1, 0, 2, true); mcLogoTweenOut.addEventListener(TweenEvent.MOTION_FINISH, freezeImage); }




Reply With Quote