# Pass variable from function which is on the main timeline, into a variable in a MC

**URL:** <https://forum.kirupa.com/t/pass-variable-from-function-which-is-on-the-main-timeline-into-a-variable-in-a-mc/305984>\
**Category:** flash\
**Created:** [March 7, 2010, 9:55am UTC](https://forum.kirupa.com/t/pass-variable-from-function-which-is-on-the-main-timeline-into-a-variable-in-a-mc/305984 "2010-03-07T09:55:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rants](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@rants](https://forum.kirupa.com/u/rants)\
**Post date:** [March 7, 2010, 9:55am UTC](https://forum.kirupa.com/t/pass-variable-from-function-which-is-on-the-main-timeline-into-a-variable-in-a-mc/305984/1 "2010-03-07T09:55:11Z")

</div>

I have a bit of code that is on my main timeline:

var myV:Number=100;  
var myV2:Number=200;

function loader() {  
myV=200+100;  
myV2=400+300;  
fn();  
}  
loader();

function fn() {  
trace(myV);  
trace(myV2);  
}

So far so good.

But i have a movieclip on my timeline, from which i would like to retrieve these evaluated values.  
I need to put these values into a another function which exists in my Movieclip’s timeline.

Any idea how that could be achieved.

Much appreciated.
