# Call a function in a mc (?)

**URL:** <https://forum.kirupa.com/t/call-a-function-in-a-mc/276750>\
**Category:** Uncategorized\
**Created:** [December 3, 2008, 9:40am UTC](https://forum.kirupa.com/t/call-a-function-in-a-mc/276750 "2008-12-03T09:40:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikman](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@mikman](https://forum.kirupa.com/u/mikman)\
**Post date:** [December 3, 2008, 9:40am UTC](https://forum.kirupa.com/t/call-a-function-in-a-mc/276750/1 "2008-12-03T09:40:36Z")

</div>

Hello everyone.

I have followed this tutorial

[http://flashexplained.com/actionscript/making-the-ultimate-dynamic-image-gallery-in-flash-8/](http://flashexplained.com/actionscript/making-the-ultimate-dynamic-image-gallery-in-flash-8/)

and all goes fine: gallery works like a charm.

But i need to add a dynamic “download pdf” button for each gallery.

I’ve been able to associate a pdf every time i clicked a gallery button adding this line to the frame code on the root  
geturl(“[http://www.mysite.com/](http://www.mysite.com/)” + whichGallery + “.pdf”);  
into “function enableButtons(numberOfGalleries:Number):Void {”  
but if i create a custom button to click for download the result is “undefined”.

I think this happen because i need to call the above function… ☹  
Really need this for a customer. Nobody seems to solve this (or even try), this is my last chance.  
Anyone please, please can help me?

Thanks in advance.
