Help calling nested movie clips from an AS3 class file
Here's what I did:
1) I created a movieclip (book_mc) on the stage. Inside the book is another movieclip (bookPages_mc). Inside of bookPages_mc is a third movieclip (subNav_mc).
2) On the root layer I created another movieclip (button).
3) On "button" I went to Linkage and gave it a base class of my own creation, "MainNav".
Now in the MainNav class I want to tell the subnavigation movieclip to animate.
The problem is - I can't figure out how to reference nested movie clips from an external class.
(For the record - everything has an instance name and has been double checked. The code works from within the FLA but not from an external class.)
Here is my class code (everything works except for the reference to the nested movieclip):
Code:
package {
//imports
import flash.display.MovieClip;
import flash.display.DisplayObject;
import flash.events.MouseEvent;
import flash.display.SimpleButton;
import gs.TweenLite;//Importing TweenLite (make sure "gs" folder is in same folder as this file
import fl.motion.easing.*;
//declare class
public class MainNav extends MovieClip {
public function MainNav() {
trace("activate Main Navigation button");
this.buttonMode = true;
this.addEventListener(MouseEvent.CLICK, handleClick);
}//end constructor function
function handleClick(event:MouseEvent):void {
//trace("handleClick");
book_mc.bookPages_mc.subNav_mc.gotoAndPlay("slide");
}//end handleClick method
}//end class
//end package
}
Please help! And please consider, when replying, that I pretty much only learned how to use classes YESTERDAY so I'm still a noob at this. Thanks in advance!