# Loaded Movie calls function in Main Interface

**URL:** https://forum.kirupa.com/t/loaded-movie-calls-function-in-main-interface/280311
**Category:** flash
**Created:** [January 26, 2009, 3:33am UTC](https://forum.kirupa.com/t/loaded-movie-calls-function-in-main-interface/280311 "2009-01-26T03:33:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Pherank](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Pherank](https://forum.kirupa.com/u/Pherank)
#### Post date: [January 26, 2009, 3:33am UTC](https://forum.kirupa.com/t/loaded-movie-calls-function-in-main-interface/280311/1 "2009-01-26T03:33:00Z")

</div>

I have an interface that contains audio controls in the Library (class: AudioControls)

When a movie is loaded into the interface, and it happens to contain a sound (class: Audio\_1), this loaded movie calls an interface function to show the audio controls:

```auto

if (Interface._ui != null) {
    Interface._ui.playCurrentAudio();
}

```

The problem is, the playCurrentAudio() func in the interface contains some code that refers to nested MCs:

```auto

        public function showAudioControls():void {
            audioControls.x = 710;
            audioControls.y = 583;
            //
            audioControls.speaker.stop();// Stop timeline animation
            audioControls.rewind_btn.audioBtnPulse.stop();// Stop timeline animation
            audioControls.playPause_btn.audioBtnPulse.stop();// Stop timeline animation
            //
            audioControls.playPause_btn.gotoAndStop("off");
            audioControls.speaker.gotoAndPlay("on");
            //
            audioControls.rewind_btn.buttonMode = true;
            audioControls.rewind_btn.useHandCursor = true;
            audioControls.rewind_btn.mouseChildren = false;
            //
            audioControls.playPause_btn.buttonMode = true;
            audioControls.playPause_btn.useHandCursor = true;
            audioControls.playPause_btn.mouseChildren = false;
            //
            audioControls.rewind_btn.addEventListener(MouseEvent.CLICK, replayCurrentAudio);
            audioControls.rewind_btn.addEventListener(MouseEvent.MOUSE_OVER,rewindRollOver);
            audioControls.rewind_btn.addEventListener(MouseEvent.MOUSE_OUT,rewindRollOut);
            audioControls.playPause_btn.addEventListener(MouseEvent.CLICK, pauseCurrentAudio);
            audioControls.playPause_btn.addEventListener(MouseEvent.MOUSE_OVER,playPauseRollOver);
            audioControls.playPause_btn.addEventListener(MouseEvent.MOUSE_OUT,playPauseRollOut);
            //
            addChild(audioControls);
            //
            var yPosTween:Tween = new Tween(audioControls, "y", Strong.easeOut, 583, 532, 0.40, true);
        }
        public function playCurrentAudio():void {
            showAudioControls();
            voiceOver = new Audio_1();
            soundControl = voiceOver.play(0,1);
            soundControl.addEventListener(Event.SOUND_COMPLETE,audioComplete);
        }

```

That would be the speaker, rewind\_btn, playPause\_btn, etc. Referring to the parent clip, “audioControls”, is no problem of course. But I get an error when I publish the loaded movie:

1119: Access of possibly undefined property speaker through a reference with static type AudioControls.  
1119: Access of possibly undefined property rewind\_btn through a reference with static type AudioControls.  
1119: Access of possibly undefined property playPause\_btn through a reference with static type AudioControls.
