# Calling a function from root that is defined in a MC?

**URL:** https://forum.kirupa.com/t/calling-a-function-from-root-that-is-defined-in-a-mc/174019
**Category:** flash
**Created:** [January 1, 2006, 11:45pm UTC](https://forum.kirupa.com/t/calling-a-function-from-root-that-is-defined-in-a-mc/174019 "2006-01-01T23:45:41Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![fuzzyfluid](https://avatars.discourse-cdn.com/v4/letter/f/fbc32d/32.png) [@fuzzyfluid](https://forum.kirupa.com/u/fuzzyfluid)
#### Post date: [January 1, 2006, 11:45pm UTC](https://forum.kirupa.com/t/calling-a-function-from-root-that-is-defined-in-a-mc/174019/1 "2006-01-01T23:45:41Z")

</div>

Hey guys, been polking around this for awhile.

i’ve got this mc component i’ve created and reuse on some sites i’ve made. It’s a real simple shoutbox that grabs info from a database using a php script.

What i’d like to do is have this component refresh every 200 frames, which means, grab most current msgs and post them in the database.

so for example, i have a movieclip called MC1. there’s a function in MC1 that goes like :

grabdata = function() {}; this basically calls the php scripts, loads the info, and so on.

i wanna call this function from the root or even a parent MC. How do i go about doing this??

thanks guys.

I have considered using prototypes or a class, but i dont think it’s really necessary for something that seems basic enough.
