9 Replies Latest reply on Apr 7, 2013 8:57 AM by Ned Murphy

    Playing a Movie Clip within a Movie Clip on load




      I'm trying to play a Movie Clip animation that is within a Movie Clip after a button has been pressed in a different Movie Clip.


      The issue is that all Movie Clip animations are playing as soon as the SWF is loaded.


      I have a separate Main.as file that contains all of the coding except for the animation stops:




                import flash.display.MovieClip;

                import flash.events.MouseEvent;


                public class Main extends MovieClip



                var title1:Title1;

                var scene1:Scene1;

                var scene2:Scene2;

                var scene3:Scene3;

                var scene4:Scene4;

                var scene5:Scene5;

                var scene6:Scene6;

                var scene7:Scene7;

                var scene8:Scene8;

                var scene9:Scene9;

                var scene10:Scene10;


                public function Main()


                          title1 = new Title1();

                          scene1 = new Scene1();

                          scene2 = new Scene2();

                          scene3 = new Scene3();

                          scene4 = new Scene4();

                          scene5 = new Scene5();

                          scene6 = new Scene6();

                          scene7 = new Scene7();

                          scene8 = new Scene8();

                          scene9 = new Scene9();

                          scene10 = new Scene10();




                          scene1.buttonWalkOutside.addEventListener(MouseEvent.CLICK,onButtonWalkOutsideC lick);



                function onButtonStartClick(event:MouseEvent):void







                function onButtonWalkOutsideClick(event:MouseEvent):void









      So right now, I'm getting this error:


      TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Stage@46534041 to Scene1.

                at Main/onButtonStartClick()


      Any help is greatly appreciated... I've been grinding at this all night.