# Dynamic movie clip reference, invoke function in mc

**URL:** https://forum.kirupa.com/t/dynamic-movie-clip-reference-invoke-function-in-mc/248030
**Category:** Uncategorized
**Created:** [January 3, 2008, 12:38am UTC](https://forum.kirupa.com/t/dynamic-movie-clip-reference-invoke-function-in-mc/248030 "2008-01-03T00:38:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kaplanyo](https://avatars.discourse-cdn.com/v4/letter/k/35a633/32.png) [@kaplanyo](https://forum.kirupa.com/u/kaplanyo)
#### Post date: [January 3, 2008, 12:38am UTC](https://forum.kirupa.com/t/dynamic-movie-clip-reference-invoke-function-in-mc/248030/1 "2008-01-03T00:38:28Z")

</div>

Happy new year all!!

I’d like to invoke a function inside a mc from it’s parent, but I want to have the reference to the clip be dynamic. When I path the mc directly and invoke the function it works, how would I make that same reference work dynamically.

Here’s a sample of what I’m trying to do:

```auto
var myArr:Array = new Array();
myArr[0] = "galleryContainer_mc.eventGallery1_mc.imgContainer_mc";
trace(myArr[0]);

// This works
toggle_btn.onRelease = function() {
	galleryContainer_mc.eventGallery1_mc.imgContainer_mc.videoToggle();
}
// But this doesn't work
toggle_btn.onRelease = function() {
	myArr[0].videoToggle();
}

```

I know I’m fried, but that seems like it should work, am I missing something really basic here? Any advice would be really helpful at this point. Thanks!
