Accessing nested ActionScript3 clips from a class
I am trying to write a very simple / minimal custom video player in Flash CS3
I have a .fla file with 2 MovieClips in my library, Player and PlayButton. The PlayButton movie clip is in the first frame inside the Player movie clip. The Player is exported to ActionScript and associated with the Player.as class, which dynamically creates a video object.
My document class is MPlayer.as and it adds a Player instance to the stage. This works well and the video will play automatically. However, the PlayButton movie clip that is inside my Player library item is not showing ... and I have no idea how to access it or get it to show. it is not in the same position as the video, so it should not be under it ... I tried addChild (playbutton_instance_name) from Player.as but I am getting errors. The Player movie clip is exported for actionscript, but the PlayButton movie clip is not inside it.
Am I getting it right?
a source to share
Sounds right. If it is in your Player MovieClip, it will be exported inside this. Are you sure it's in the Player video? You can access it just like your Player.as class variable, i.e. If the PlayButton has an instance name "playBtn" you can (in a constructor function) try
public function Play()
{
trace(this.playBtn);
}
And if the clip is in the class correctly, it should trace something like [PlayButton]. If you want please post your code in your question or I can look at your files if you like.
a source to share