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:
public class Main extends MovieClip
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();
So right now, I'm getting this error:
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Stage@46534041 to Scene1.
Any help is greatly appreciated... I've been grinding at this all night.
I'm attempting to play frame 1 (labelled frame1) of the movie clip I'm trying to animate.
From everything I've tried, I can only get that clip to play from when the SWF is loaded. I'm trying to make this clip to play when onButtonStartClick is used.
You basically just read the code back to me. I am asking a more pointed question. What is the movieclip you are trying to animate and why are you casting it as "Scene1()" to try to target it?
If the object you want to animate happens to be "scene1", then just target scene1.
Then use: scene1Text1.gotoAndPlay("frame1");
If that is not what you are really trying to do in the coding of it, then explain it in more detail.
I don't see where a Scene1 object could be the parent of anything relative to the function you were trying to use it in. What is that parent you are trying to target the parent of?
I had been trying a bunch of different methods after searching for clues on Google, so it probably doesn't make sense with the parent.
I replaced the code with what you wrote, and I am given this error now:
|Main.as, Line 44||1120: Access of undefined property scene1Text1.|
Is there somewhere I have to declare scene1Text1 in Main.as?