Take the 2-minute tour ×

I'm trying to control the main timeline of my flash application from a MovieClip that is a child of the main stage. Apparently, in ActionScript 2, you could do that using _root, but using root (since _root no longer exists) now gives an error:


"1061: Call to a possibly undefined method play through a reference with static type flash.display:DisplayObjectContainer."

Using the Stage class also doesn't work:


"1061: Call to a possibly undefined method play through a reference with static type flash.display:Stage."

Is there any way to do this?

share|improve this question
add comment

3 Answers

up vote 7 down vote accepted

You need to cast it to a MovieClip

(root as MovieClip).play()
share|improve this answer
yep, or MovieClip(root).play() - depends where you want the error to throw! –  Iain Nov 14 '08 at 11:03
add comment

According to http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=665&threadid=1387264&enterthread=y,

try something like

Good Luck,
Randy Stegbauer

share|improve this answer
add comment

Another way is separate your movieclip code into separate class while setting document class for your main fla.

Assume the document class of your main fla is Main.as and your movieclip's class file is Movie.as, you can add Main class pointer as parameter in the Movie class constructor

In Main.as

public class Main() { var m = new Movie(this); }

In Movie.as

public class Movie(m:Main) { m.gotoAndPlay("somewhere"); }
share|improve this answer
add comment

Your Answer


