PDA

View Full Version : Accessing Document Class Methods from Within MovieClip


theclincher
08-27-2008, 06:35 AM
Let's say I have a FLA file with document class called main. In main, let's say I have a method called test1 that just outputs "hello world" via trace. On the FLA I have a movie clip. In that movie clip, when the timeline reaches frame 123, I want it to invoke the test1 method (I just set up a simple action on the frame). However, I get an error saying that the method is undefined. I try this.parent.test1() too but that gives me the same error. Is it not possible to invoke a document class property from within the timeline of a movie clip that's on the stage?

DiamondDog
08-27-2008, 11:28 AM
In AS3 I'd put put the following code inside the movie clip

MovieClip(root).test1();

I guess that's not going to work in Flash9?

theclincher
08-27-2008, 11:20 PM
nope, that doesn't work